1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/asm.js/testUseAsmWarnings.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,14 @@ 1.4 +load(libdir + "asm.js"); 1.5 + 1.6 +assertAsmDirectiveFail("'use asm'"); 1.7 +assertAsmDirectiveFail("eval('\"use asm\";');"); 1.8 +assertAsmDirectiveFail("{ eval('\"use asm\";'); }"); 1.9 +assertAsmDirectiveFail("if (Math) { 'use asm'; }"); 1.10 +assertAsmDirectiveFail("function f(){ { 'use asm'; } }"); 1.11 +assertAsmDirectiveFail("function f(){ ; 'use asm'; } }"); 1.12 +assertAsmDirectiveFail("function f(){ 1; 'use asm'; } }"); 1.13 +assertAsmDirectiveFail("function f(){ var x; 'use asm'; } }"); 1.14 +assertAsmDirectiveFail("function f(){ if (Math) { 'use asm'; } }"); 1.15 +assertAsmDirectiveFail("(function(){ eval('\"use asm\";') })()"); 1.16 +assertAsmDirectiveFail("new Function('{\"use asm\";}')"); 1.17 +assertAsmDirectiveFail("new Function('if (Math){\"use asm\";}')");