File: scannerUnicodeEscapeInKeyword2.js

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (64 lines) | stat: -rw-r--r-- 1,504 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//// [tests/cases/conformance/scanner/ecmascript5/scannerUnicodeEscapeInKeyword2.ts] ////

//// [file1.ts]
var \u0061wait = 12; // ok
async function main() {
    \u0061wait 12; // not ok
}

var \u0079ield = 12; // ok
function *gen() {
    \u0079ield 12; //not ok
}

type typ\u0065 = 12; // ok

typ\u0065 notok = 0; // not ok

export {};
//// [file2.ts]
\u{0076}ar x = "hello"; // not ok

var \u{0061}wait = 12; // ok
async function main() {
    \u{0061}wait 12; // not ok
}

var \u{0079}ield = 12; // ok
function *gen() {
    \u{0079}ield 12; //not ok
}

type typ\u{0065} = 12; // ok

typ\u{0065} notok = 0; // not ok

export {};

const a = {def\u0061ult: 12}; // OK, `default` not in keyword position
// 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


//// [file1.js]
var \u0061wait = 12; // ok
async function main() {
    await 12; // not ok
}
var \u0079ield = 12; // ok
function* gen() {
    yield 12; //not ok
}
export {};
//// [file2.js]
var x = "hello"; // not ok
var \u{0061}wait = 12; // ok
async function main() {
    await 12; // not ok
}
var \u{0079}ield = 12; // ok
function* gen() {
    yield 12; //not ok
}
const a = { def\u0061ult: 12 }; // OK, `default` not in keyword position
export {};
// 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