Browse Source

Testcases for probable utf-8 lexer bug (GH-103)

pull/113/head
Sami Vaarala 10 years ago
parent
commit
3d74b24a40
  1. 19
      ecmascript-testcases/test-bug-utf8-varname.js
  2. 6
      ecmascript-testcases/test-lex-utf8.js

19
ecmascript-testcases/test-bug-utf8-varname.js

@ -0,0 +1,19 @@
/*
* https://github.com/svaarala/duktape/issues/103
*/
/*===
count: 2
===*/
function test() {
var my_变量=1;
my_变量++;
print('count:', my_变量);
}
try {
test();
} catch (e) {
print(e.stack || e);
}

6
ecmascript-testcases/test-lex-utf8.js

@ -4,12 +4,15 @@
/*===
äö
变量
1 number
2 number
3 number
===*/
// These chars are in UTF-8 format in the source file
print('äö');
print('变量');
/* Note: smjs fails the tests below (Rhino does not) */
@ -18,3 +21,6 @@ print($äöå, typeof $äöå);
äöå = 2;
print(äöå, typeof äöå);
my_变量 = 3;
print(my_变量, typeof my_变量);

Loading…
Cancel
Save