Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
1 // Any copyright is dedicated to the Public Domain.
2 // http://creativecommons.org/licenses/publicdomain/
4 //-----------------------------------------------------------------------------
5 var BUGNUMBER = 601262;
6 var summary =
7 "A string literal containing an octal escape before a strict mode " +
8 "directive should be a syntax error";
10 print(BUGNUMBER + ": " + summary);
12 /**************
13 * BEGIN TEST *
14 **************/
16 try
17 {
18 eval(" '\\145'; 'use strict'; ");
19 throw new Error("no error thrown for eval");
20 }
21 catch (e)
22 {
23 assertEq(e instanceof SyntaxError, true,
24 "wrong error for octal-escape before strict directive in eval");
25 }
27 try
28 {
29 Function(" '\\145'; 'use strict'; ");
30 throw new Error("no error thrown for Function");
31 }
32 catch (e)
33 {
34 assertEq(e instanceof SyntaxError, true,
35 "wrong error for octal-escape before strict directive in Function");
36 }
38 try
39 {
40 eval(" function f(){ '\\145'; 'use strict'; } ");
41 throw new Error("no error thrown for eval of function");
42 }
43 catch (e)
44 {
45 assertEq(e instanceof SyntaxError, true,
46 "wrong error for octal-escape before strict directive in eval of " +
47 "function");
48 }
50 try
51 {
52 Function(" function f(){ '\\145'; 'use strict'; } ");
53 throw new Error("no error thrown for eval of function");
54 }
55 catch (e)
56 {
57 assertEq(e instanceof SyntaxError, true,
58 "wrong error for octal-escape before strict directive in eval of " +
59 "function");
60 }
62 eval("function notAnError1() { 5; '\\145'; function g() { 'use strict'; } }");
64 Function("function notAnError2() { 5; '\\145'; function g() { 'use strict'; } }");
66 function notAnError3()
67 {
68 5;
69 "\145";
70 function g() { "use strict"; }
71 }
73 /******************************************************************************/
75 if (typeof reportCompare === "function")
76 reportCompare(true, true);
78 print("All tests passed!");