js/src/jit-test/tests/arguments/testDelArg3.js

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

michael@0 1 function assertGood(x) {
michael@0 2 assertEq(x, "good");
michael@0 3 }
michael@0 4
michael@0 5 (function() {
michael@0 6 var a = arguments;
michael@0 7 return function() {
michael@0 8 assertGood.apply(null, a);
michael@0 9 }
michael@0 10 })("good")();
michael@0 11
michael@0 12 (function() {
michael@0 13 var a = arguments;
michael@0 14 return function() {
michael@0 15 a[0] = "good";
michael@0 16 assertGood.apply(null, a);
michael@0 17 }
michael@0 18 })("bad")();
michael@0 19
michael@0 20 Object.prototype[0] = "good";
michael@0 21
michael@0 22 (function() {
michael@0 23 var a = arguments;
michael@0 24 return function() {
michael@0 25 delete a[0];
michael@0 26 assertGood.apply(null, a);
michael@0 27 }
michael@0 28 })("bad")();
michael@0 29
michael@0 30 delete Object.prototype[0];
michael@0 31
michael@0 32 function assertUndefined(x) {
michael@0 33 assertEq(x, undefined);
michael@0 34 }
michael@0 35
michael@0 36 (function() {
michael@0 37 var a = arguments;
michael@0 38 return function() {
michael@0 39 a[0] = "bad";
michael@0 40 assertUndefined.apply(null, a);
michael@0 41 }
michael@0 42 })()();

mercurial