1 // Any copyright is dedicated to the Public Domain.
2 // http://creativecommons.org/licenses/publicdomain/
4 //-----------------------------------------------------------------------------
5 var BUGNUMBER
= 601262;
7 "A string literal containing an octal escape before a strict mode " +
8 "directive should be a syntax error";
10 print(BUGNUMBER
+ ": " + summary
);
18 eval(" '\\145'; 'use strict'; ");
19 throw new Error("no error thrown for eval");
23 assertEq(e
instanceof SyntaxError
, true,
24 "wrong error for octal-escape before strict directive in eval");
29 Function(" '\\145'; 'use strict'; ");
30 throw new Error("no error thrown for Function");
34 assertEq(e
instanceof SyntaxError
, true,
35 "wrong error for octal-escape before strict directive in Function");
40 eval(" function f(){ '\\145'; 'use strict'; } ");
41 throw new Error("no error thrown for eval of function");
45 assertEq(e
instanceof SyntaxError
, true,
46 "wrong error for octal-escape before strict directive in eval of " +
52 Function(" function f(){ '\\145'; 'use strict'; } ");
53 throw new Error("no error thrown for eval of function");
57 assertEq(e
instanceof SyntaxError
, true,
58 "wrong error for octal-escape before strict directive in eval of " +
62 eval("function notAnError1() { 5; '\\145'; function g() { 'use strict'; } }");
64 Function("function notAnError2() { 5; '\\145'; function g() { 'use strict'; } }");
66 function notAnError3()
70 function g() { "use strict"; }
73 /******************************************************************************/
75 if (typeof reportCompare
=== "function")
76 reportCompare(true, true);
78 print("All tests passed!");
80 var successfullyParsed
= true;