diff options
Diffstat (limited to 'integration/snippets')
-rw-r--r-- | integration/snippets/string-escapes.js | 35 | ||||
-rw-r--r-- | integration/snippets/unicode-identifiers.js | 15 |
2 files changed, 50 insertions, 0 deletions
diff --git a/integration/snippets/string-escapes.js b/integration/snippets/string-escapes.js new file mode 100644 index 000000000..dc5c7cff9 --- /dev/null +++ b/integration/snippets/string-escapes.js @@ -0,0 +1,35 @@ +var tab = "\t"; +var シ = "wow"; +var f = ""; +var obj = { + "\r\n": "\r\n", + "\n": "\n", + "\t": "\t", + "\u2028": "\u2028", + "\u2029": "\u2029", + "😊": "😊", + "😃": "😃", + "㋡": "㋡", + "☺": "☺", + シ: "シ", + f: f, + "☹": "☹", + "☻": "☻", + children: 123, +}; +const foo = () => {}; +const Bar = foo("a", { + children: 123, +}); + +const carriage = obj["\r\n"]; +const newline = obj["\n"]; + +export { obj }; + +export function test() { + console.assert(carriage === "\r\n"); + console.assert(newline === "\n"); + console.assert(tab === "\t"); + return testDone(import.meta.url); +} diff --git a/integration/snippets/unicode-identifiers.js b/integration/snippets/unicode-identifiers.js new file mode 100644 index 000000000..5b602f49b --- /dev/null +++ b/integration/snippets/unicode-identifiers.js @@ -0,0 +1,15 @@ +var ε = 1e-6, + ε2 = ε * ε, + π = Math.PI, + τ = 2 * π, + τε = τ - ε, + halfπ = π / 2, + d3_radians = π / 180, + d3_degrees = 180 / π; + +export { d3_radians }; + +export function test() { + console.assert(ε === 1e-6); + return testDone(import.meta.url); +} |