You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add error message for keywords with escapes in them (microsoft#32718)
* Add error message for keywords with escapes in them
* Move check into parser during advance to next token to utilize context for contextual keywords
* git add .
* Add tests for extended escapes
* Better error courtesy of @DanielRossenwaser
* Add test of browser-inconsistent case and alter condition to match spec
* Merge adjacent conditions
* Use seperate functions for checking keywords vs not
* Use flags to track unicode escape presence
* Adjust error text
const a = {def\u0061ult: 12}; // OK, `default` not in keyword position
60
+
// chrome and jsc may still error on this, ref https://bugs.chromium.org/p/chromium/issues/detail?id=993000 and https://bugs.webkit.org/show_bug.cgi?id=200638
consta={def\u0061ult: 12};// OK, `default` not in keyword position
39
+
// chrome and jsc may still error on this, ref https://bugs.chromium.org/p/chromium/issues/detail?id=993000 and https://bugs.webkit.org/show_bug.cgi?id=200638
40
+
41
+
42
+
//// [file1.js]
43
+
var\u0061wait=12;// ok
44
+
asyncfunctionmain(){
45
+
await12;// not ok
46
+
}
47
+
var\u0079ield=12;// ok
48
+
function*gen(){
49
+
yield12;//not ok
50
+
}
51
+
//// [file2.js]
52
+
varx="hello";// not ok
53
+
var\u{0061}wait=12;// ok
54
+
asyncfunctionmain(){
55
+
await12;// not ok
56
+
}
57
+
var\u{0079}ield=12;// ok
58
+
function*gen(){
59
+
yield12;//not ok
60
+
}
61
+
consta={def\u0061ult: 12};// OK, `default` not in keyword position
62
+
// chrome and jsc may still error on this, ref https://bugs.chromium.org/p/chromium/issues/detail?id=993000 and https://bugs.webkit.org/show_bug.cgi?id=200638
0 commit comments