summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Array/prototype/map/15.4.4.19-8-7.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Array/prototype/map/15.4.4.19-8-7.js')
-rw-r--r--js/src/tests/test262/built-ins/Array/prototype/map/15.4.4.19-8-7.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Array/prototype/map/15.4.4.19-8-7.js b/js/src/tests/test262/built-ins/Array/prototype/map/15.4.4.19-8-7.js
new file mode 100644
index 0000000000..6d203fceba
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Array/prototype/map/15.4.4.19-8-7.js
@@ -0,0 +1,25 @@
+// Copyright (c) 2012 Ecma International. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-array.prototype.map
+description: Array.prototype.map successful to delete the object in callbackfn
+---*/
+
+var obj = {};
+obj.srcArr = [1, 2, 3, 4, 5];
+
+function callbackfn(val, idx, obj) {
+ delete obj.srcArr;
+ if (val > 0)
+ return 1;
+ else
+ return 0;
+}
+
+var resArr = obj.srcArr.map(callbackfn);
+
+assert.sameValue(resArr.toString(), "1,1,1,1,1", 'resArr.toString()');
+assert.sameValue(obj.hasOwnProperty("arr"), false, 'obj.hasOwnProperty("arr")');
+
+reportCompare(0, 0);