OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 // Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
6 // are met: | 6 // are met: |
7 // 1. Redistributions of source code must retain the above copyright | 7 // 1. Redistributions of source code must retain the above copyright |
8 // notice, this list of conditions and the following disclaimer. | 8 // notice, this list of conditions and the following disclaimer. |
9 // 2. Redistributions in binary form must reproduce the above copyright | 9 // 2. Redistributions in binary form must reproduce the above copyright |
10 // notice, this list of conditions and the following disclaimer in the | 10 // notice, this list of conditions and the following disclaimer in the |
(...skipping 23 matching lines...) Expand all Loading... |
34 } | 34 } |
35 function testThisBracketAccess(prop) { | 35 function testThisBracketAccess(prop) { |
36 "use strict"; | 36 "use strict"; |
37 return this[prop]; | 37 return this[prop]; |
38 } | 38 } |
39 function testGlobalAccess() { | 39 function testGlobalAccess() { |
40 return testThis(); | 40 return testThis(); |
41 } | 41 } |
42 function shouldBeSyntaxError(str) { | 42 function shouldBeSyntaxError(str) { |
43 shouldThrow(str); | 43 shouldThrow(str); |
44 shouldThrow("(function(){" + str + "})"); | 44 shouldThrow("(function (){" + str + "})"); |
45 } | 45 } |
46 function testLineContinuation() { | 46 function testLineContinuation() { |
47 "use stric\ | 47 "use stric\ |
48 t"; | 48 t"; |
49 return this; | 49 return this; |
50 } | 50 } |
51 function testEscapeSequence() { | 51 function testEscapeSequence() { |
52 "use\u0020strict"; | 52 "use\u0020strict"; |
53 return this; | 53 return this; |
54 } | 54 } |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 shouldBeTrue("(function () {'use strict'; try { throw 1; } catch (e) { aGlobal
= true; }})(); aGlobal;"); | 224 shouldBeTrue("(function () {'use strict'; try { throw 1; } catch (e) { aGlobal
= true; }})(); aGlobal;"); |
225 aGlobal = false; | 225 aGlobal = false; |
226 shouldBeTrue("try { throw 1; } catch (e) { aGlobal = true; }"); | 226 shouldBeTrue("try { throw 1; } catch (e) { aGlobal = true; }"); |
227 aGlobal = false; | 227 aGlobal = false; |
228 shouldBeTrue("(function () { try { throw 1; } catch (e) { aGlobal = true; }})();
aGlobal;"); | 228 shouldBeTrue("(function () { try { throw 1; } catch (e) { aGlobal = true; }})();
aGlobal;"); |
229 aGlobal = false; | 229 aGlobal = false; |
230 shouldBeTrue("(function () {try { throw 1; } catch (e) { aGlobal = true; }})();
aGlobal;"); | 230 shouldBeTrue("(function () {try { throw 1; } catch (e) { aGlobal = true; }})();
aGlobal;"); |
231 | 231 |
232 // Make sure this doesn't crash! | 232 // Make sure this doesn't crash! |
233 shouldBe('String(Object.getOwnPropertyDescriptor((function() { "use strict"; }).
__proto__, "caller").get)', "'function () {\\n [native code]\\n}'"); | 233 shouldBe('String(Object.getOwnPropertyDescriptor((function() { "use strict"; }).
__proto__, "caller").get)', "'function () {\\n [native code]\\n}'"); |
OLD | NEW |