diff options
author | Fedor Indutny <fedor.indutny@gmail.com> | 2013-01-01 12:28:07 +0400 |
---|---|---|
committer | Fedor Indutny <fedor.indutny@gmail.com> | 2013-01-01 16:07:02 +0400 |
commit | 7b4d95a976f1b76e6dcefb6ca91dff738c80ab7a (patch) | |
tree | 1eb943733a2e660fc0183778fd441443e06196e2 /deps/v8/test/mjsunit/strict-mode.js | |
parent | 9e32c2ef3ede29ba0ae2086bdf658f6cd44182df (diff) | |
download | android-node-v8-7b4d95a976f1b76e6dcefb6ca91dff738c80ab7a.tar.gz android-node-v8-7b4d95a976f1b76e6dcefb6ca91dff738c80ab7a.tar.bz2 android-node-v8-7b4d95a976f1b76e6dcefb6ca91dff738c80ab7a.zip |
deps: update v8 to 3.15.11
Diffstat (limited to 'deps/v8/test/mjsunit/strict-mode.js')
-rw-r--r-- | deps/v8/test/mjsunit/strict-mode.js | 47 |
1 files changed, 36 insertions, 11 deletions
diff --git a/deps/v8/test/mjsunit/strict-mode.js b/deps/v8/test/mjsunit/strict-mode.js index 9c9bdfd52d..5fb404a799 100644 --- a/deps/v8/test/mjsunit/strict-mode.js +++ b/deps/v8/test/mjsunit/strict-mode.js @@ -1141,9 +1141,9 @@ function CheckPillDescriptor(func, name) { function strict() { "use strict"; - return_my_caller(); + return return_my_caller(); } - assertThrows(strict, TypeError); + assertSame(null, strict()); function non_strict() { return return_my_caller(); @@ -1155,32 +1155,57 @@ function CheckPillDescriptor(func, name) { (function TestNonStrictFunctionCallerPill() { function strict(n) { "use strict"; - non_strict(n); + return non_strict(n); } function recurse(n, then) { if (n > 0) { - recurse(n - 1); + return recurse(n - 1, then); } else { return then(); } } function non_strict(n) { - recurse(n, function() { non_strict.caller; }); + return recurse(n, function() { return non_strict.caller; }); } function test(n) { - try { - recurse(n, function() { strict(n); }); - } catch(e) { - return e instanceof TypeError; + return recurse(n, function() { return strict(n); }); + } + + for (var i = 0; i < 10; i ++) { + assertSame(null, test(i)); + } +})(); + + +(function TestNonStrictFunctionCallerDescriptorPill() { + function strict(n) { + "use strict"; + return non_strict(n); + } + + function recurse(n, then) { + if (n > 0) { + return recurse(n - 1, then); + } else { + return then(); } - return false; + } + + function non_strict(n) { + return recurse(n, function() { + return Object.getOwnPropertyDescriptor(non_strict, "caller").value; + }); + } + + function test(n) { + return recurse(n, function() { return strict(n); }); } for (var i = 0; i < 10; i ++) { - assertEquals(test(i), true); + assertSame(null, test(i)); } })(); |