Skip to content

Commit

Permalink
Iss4248 unicode code point escapes (cleanup) (#4522)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Julian Rosse authored and GeoffreyBooth committed Apr 22, 2017
1 parent 96b6c5f commit ac1b2b5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 18 deletions.
6 changes: 0 additions & 6 deletions test/modules.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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", ->
Expand Down
6 changes: 0 additions & 6 deletions test/regexps.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
6 changes: 0 additions & 6 deletions test/strings.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions test/support/helpers.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit ac1b2b5

Please sign in to comment.