svaarala / duktape

Duktape - embeddable Javascript engine with a focus on portability and compact footprint
MIT License
5.93k stars 514 forks source link

ES2015 Extended Literals #274

Open kphillisjr opened 9 years ago

kphillisjr commented 9 years ago

This is not a lot of features, but this is general features revolving around strings. (This and more examples can be found at: http://es6-features.org/ )

svaarala commented 7 years ago

Regarding Unicode literals, the following work in master:

duk> "𠮷".length
= 2
duk> "\u{20BB7}" === "𠮷"
= true
duk> "𠮷" === "\uD842\uDFB7"
= true
duk> "𠮷".codePointAt(0) == 0x20BB7;
= true

What doesn't yet work is:

// No RegExp /u mode yet
"𠮷".match(/./u)[0].length === 2;

// No for-of iteration yet
for (let codepoint of "𠮷") console.log(codepoint);