Skip to content

Commit

Permalink
Split Unicode Escape tests
Browse files Browse the repository at this point in the history
Babel is [concerned](babel/babel#11377) with a few unique cases:

1. Escapes in strings
2. Escapes in bare identifiers
3. Escapes in the property keys

These require a slightly different transform for each, and only strings and property keys are actually transformable. If we encounter an escape in a bare identifier, we currently error out.
  • Loading branch information
jridgewell committed May 18, 2020
1 parent 20a1512 commit ca7b85b
Show file tree
Hide file tree
Showing 2 changed files with 1,007 additions and 694 deletions.
43 changes: 41 additions & 2 deletions data-es6.js
Expand Up @@ -17253,8 +17253,8 @@ exports.tests = [
{
name: 'in identifiers',
exec: function(){/*
var \u{102C0} = { \u{102C0} : 2 };
return \u{102C0}['\ud800\udec0'] === 2;
var \u{102C0} = 2;
return \u{102C0} === 2;
*/},
res: {
ejs: true,
Expand All @@ -17273,6 +17273,45 @@ exports.tests = [
jerryscript2_0: false,
}
},
{
name: 'in property key definitions',
exec: function(){/*
var o = { \u{102C0} : 2 };
return o['\ud800\udec0'] === 2;
*/},
res: {
ejs: true,
edge12: true,
chrome44: true,
firefox2: false,
firefox53: true,
opera10_50: false,
safari9: true,
node4: true,
xs6: true,
jxa: true,
duktape2_0: true,
graalvm19: true,
graalvm20: true,
jerryscript2_0: false,
}
},
{
name: 'in property key accesses',
exec: function(){/*
var o = { '\ud800\udec0' : 2 };
return o.\u{102C0} === 2;
*/},
res: {
edge12: true,
chrome44: true,
firefox2: false,
firefox53: true,
opera10_50: false,
safari9: true,
node4: true,
}
},
]
},
{
Expand Down

0 comments on commit ca7b85b

Please sign in to comment.