Skip to content

Commit

Permalink
[js] do not consider the empty string a valid JS identifier (closes H…
Browse files Browse the repository at this point in the history
  • Loading branch information
Simn committed Feb 23, 2015
1 parent c13be74 commit 6018767
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion genjs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ let kwds2 =
h

let valid_js_ident s =
try
String.length s > 0 && try
for i = 0 to String.length s - 1 do
match String.unsafe_get s i with
| 'a'..'z' | 'A'..'Z' | '$' | '_' -> ()
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/src/unitstd/Map.unit.hx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ map.exists(c) == true;
map.get(b) == null;

// [] access
/*
var map = new Map();
map["foo"] == null;
map["foo"] = 12;
Expand All @@ -165,4 +164,5 @@ map[(function(s) return s + "o")("fo")] == 1;
map["bar"] = map["foo"] = 9;
map["bar"] == 9;
map["foo"] == 9;
*/

['' => ''].keys().next() == '';

0 comments on commit 6018767

Please sign in to comment.