Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1815)

Unified Diff: test/mjsunit/harmony/reflect-enumerate-opt.js

Issue 1397443013: [es6] Implement Reflect.enumerate. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/mjsunit/harmony/reflect-enumerate-opt.js
diff --git a/test/mjsunit/for-in-opt.js b/test/mjsunit/harmony/reflect-enumerate-opt.js
similarity index 83%
copy from test/mjsunit/for-in-opt.js
copy to test/mjsunit/harmony/reflect-enumerate-opt.js
index 67ef2d870e238b16c969184632563c81f9be2a3e..34cd660c8ff0b93497e4fb322bd6de09e0b0096d 100644
--- a/test/mjsunit/for-in-opt.js
+++ b/test/mjsunit/harmony/reflect-enumerate-opt.js
@@ -2,14 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --harmony-proxies --allow-natives-syntax
+// This is adapted from mjsunit/for-in-opt.js.
+
+// Flags: --harmony-proxies --harmony-reflect --allow-natives-syntax
+
"use strict";
-// Test non-JSObject receiver.
function f(o) {
var result = [];
- for (var i in o) {
+ for (var i of Reflect.enumerate(Object(o))) {
result.push(i);
}
return result;
@@ -51,7 +53,7 @@ var o = {__proto__: proxy};
function f2(o) {
var result = [];
- for (var i in o) {
+ for (var i of Reflect.enumerate(o)) {
result.push(i);
}
return result;
@@ -73,14 +75,3 @@ check_f2();
%OptimizeFunctionOnNextCall(f2);
deopt_has = true;
check_f2();
-
-function f3(o) {
- for (var i in o) {
- }
-}
-
-f3({__proto__:{x:1}});
-f3({__proto__:{x:1}});
-%OptimizeFunctionOnNextCall(f3);
-f3(undefined);
-f3(null);
« no previous file with comments | « test/mjsunit/harmony/reflect-enumerate-delete.js ('k') | test/mjsunit/harmony/reflect-enumerate-special-cases.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698