Index: test/mjsunit/regress/regress-2568.js |
diff --git a/test/mjsunit/regress/regress-147497.js b/test/mjsunit/regress/regress-2568.js |
similarity index 70% |
copy from test/mjsunit/regress/regress-147497.js |
copy to test/mjsunit/regress/regress-2568.js |
index 92e29d12589984b0cf34a91d7cac3479a04bfbaa..7918e148c483d6f77aadb8b756c7a0eba591b60c 100644 |
--- a/test/mjsunit/regress/regress-147497.js |
+++ b/test/mjsunit/regress/regress-2568.js |
@@ -25,21 +25,22 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-// Flags: --expose-debug-as debug |
- |
-Debug = debug.Debug; |
- |
-function listener(event, exec_state, event_data, data) { |
- if (event == Debug.DebugEvent.Break) { |
- exec_state.prepareStep(Debug.StepAction.StepNext, 10); |
- } |
+function pluck1(a, key) { |
+ return a.map(function(item) { return item[key]; }); |
}; |
+assertArrayEquals([2, 2], pluck1([[0, 0], [0, 0]], 'length')); |
+assertArrayEquals([1, 3], pluck1([[1, 2], [3, 4]], '0')); |
-Debug.setListener(listener); |
- |
-var statement = ""; |
-for (var i = 0; i < 1024; i++) statement += "z"; |
-statement = 'with(0)' + statement + '=function foo(){}'; |
+function pluck2(a, key) { |
+ return a.map(function(item) { return item[key]; }); |
+}; |
+assertArrayEquals([2, 2], pluck2(["ab", "cd"], 'length')); |
+assertArrayEquals(["a", "c"], pluck2(["ab", "cd"], '0')); |
-debugger; |
-eval(statement); |
+function pluck3(a, key) { |
+ return a.map(function(item) { return item[key]; }); |
+}; |
+f = function() { 1 }; |
+f.prototype = g = function() { 2 }; |
+assertArrayEquals([g, g], pluck3([f, f], 'prototype')); |
+assertArrayEquals([undefined, undefined], pluck3([f, f], '0')); |