mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-25 20:01:50 +00:00
Bug 1066827 - Part9: Add Testcase for Illegal character error. r=Waldo
This commit is contained in:
parent
8e307a6686
commit
20812e6912
@ -0,0 +1,57 @@
|
||||
var JSMSG_ILLEGAL_CHARACTER = "illegal character";
|
||||
|
||||
function test_reflect(code) {
|
||||
var caught = false;
|
||||
try {
|
||||
Reflect.parse(code);
|
||||
} catch (e) {
|
||||
caught = true;
|
||||
assertEq(e instanceof SyntaxError, true, code);
|
||||
assertEq(e.message, JSMSG_ILLEGAL_CHARACTER, code);
|
||||
}
|
||||
assertEq(caught, true);
|
||||
}
|
||||
|
||||
function test_eval(code) {
|
||||
var caught = false;
|
||||
try {
|
||||
eval(code);
|
||||
} catch (e) {
|
||||
caught = true;
|
||||
assertEq(e instanceof SyntaxError, true, code);
|
||||
assertEq(e.message, JSMSG_ILLEGAL_CHARACTER, code);
|
||||
}
|
||||
assertEq(caught, true);
|
||||
}
|
||||
|
||||
|
||||
function test(code) {
|
||||
test_reflect(code);
|
||||
test_eval(code);
|
||||
}
|
||||
|
||||
test("(function() { 'use asm'; @");
|
||||
test("(function() { 'use asm'; var @");
|
||||
test("(function() { 'use asm'; var a @");
|
||||
test("(function() { 'use asm'; var a = @");
|
||||
test("(function() { 'use asm'; var a = 1 @");
|
||||
test("(function() { 'use asm'; var a = 1; @");
|
||||
test("(function() { 'use asm'; var a = 1; function @");
|
||||
test("(function() { 'use asm'; var a = 1; function f @");
|
||||
test("(function() { 'use asm'; var a = 1; function f( @");
|
||||
test("(function() { 'use asm'; var a = 1; function f() @");
|
||||
test("(function() { 'use asm'; var a = 1; function f() { @");
|
||||
test("(function() { 'use asm'; var a = 1; function f() { } @");
|
||||
test("(function() { 'use asm'; var a = 1; function f() { } var @");
|
||||
test("(function() { 'use asm'; var a = 1; function f() { } var tbl @");
|
||||
test("(function() { 'use asm'; var a = 1; function f() { } var tbl = @");
|
||||
test("(function() { 'use asm'; var a = 1; function f() { } var tbl = [ @");
|
||||
test("(function() { 'use asm'; var a = 1; function f() { } var tbl = [f @");
|
||||
test("(function() { 'use asm'; var a = 1; function f() { } var tbl = [f] @");
|
||||
test("(function() { 'use asm'; var a = 1; function f() { } var tbl = [f]; @");
|
||||
test("(function() { 'use asm'; var a = 1; function f() { } var tbl = [f]; return @");
|
||||
test("(function() { 'use asm'; var a = 1; function f() { } var tbl = [f]; return f @");
|
||||
test("(function() { 'use asm'; var a = 1; function f() { } var tbl = [f]; return f; @");
|
||||
test("(function() { 'use asm'; var a = 1; function f() { } var tbl = [f]; return f; } @");
|
||||
test("(function() { 'use asm'; var a = 1; function f() { } var tbl = [f]; return f; }) @");
|
||||
test("(function() { 'use asm'; var a = 1; function f() { } var tbl = [f]; return f; }); @");
|
1073
js/src/jit-test/tests/basic/syntax-error-illegal-character.js
Normal file
1073
js/src/jit-test/tests/basic/syntax-error-illegal-character.js
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user