Iss4248 unicode code point escapes (cleanup) (#4522)

* Fix #4248: Unicode code point escapes

* rewrite unicode code point escapes as unicode escapes

* smarter defaults

* and resimplify

* correct surrogate pairs

* fixes from code review

* handle adjacent code point escapes

* smarter regex

* fix from code review

* refactor toJS() to shared test helper
This commit is contained in:
Julian Rosse
2017-04-22 13:10:10 -05:00
committed by Geoffrey Booth
parent 96b6c5f65a
commit ac1b2b5c30
4 changed files with 4 additions and 18 deletions

View File

@@ -36,12 +36,6 @@
# CoffeeScript also supports optional commas within `{ … }`.
# Helper function
toJS = (str) ->
CoffeeScript.compile str, bare: yes
.replace /^\s+|\s+$/g, '' # Trim leading/trailing whitespace
# Import statements
test "backticked import statement", ->

View File

@@ -6,12 +6,6 @@
# * Regexen
# * Heregexen
# Helper function
toJS = (str) ->
CoffeeScript.compile str, bare: yes
.replace /^\s+|\s+$/g, '' # Trim leading/trailing whitespace
test "basic regular expression literals", ->
ok 'a'.match(/a/)
ok 'a'.match /a/

View File

@@ -7,12 +7,6 @@
# * Strings
# * Heredocs
# Helper function
toJS = (str) ->
CoffeeScript.compile str, bare: yes
.replace /^\s+|\s+$/g, '' # Trim leading/trailing whitespace
test "backslash escapes", ->
eq "\\/\\\\", /\/\\/.source

View File

@@ -15,3 +15,7 @@ arrayEgal = (a, b) ->
exports.eq = (a, b, msg) -> ok egal(a, b), msg or "Expected #{a} to equal #{b}"
exports.arrayEq = (a, b, msg) -> ok arrayEgal(a,b), msg or "Expected #{a} to deep equal #{b}"
exports.toJS = (str) ->
CoffeeScript.compile str, bare: yes
.replace /^\s+|\s+$/g, '' # Trim leading/trailing whitespace