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

Unified Diff: test/mjsunit/for-in-opt.js

Issue 1516843002: [proxy] fixing harmony/proxy.js tests and improving error messages + some drive-by fixes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: WIP fix protoype walks with access checks Created 5 years 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/for-in-opt.js
diff --git a/test/mjsunit/for-in-opt.js b/test/mjsunit/for-in-opt.js
index 996f53979abd17649c701d4977e76f85c2f5f927..e458e1d537806bd8924b88457339ff2349f4d972 100644
--- a/test/mjsunit/for-in-opt.js
+++ b/test/mjsunit/for-in-opt.js
@@ -17,6 +17,7 @@ function f(o) {
assertEquals(["0"], f("a"));
assertEquals(["0"], f("a"));
+
%OptimizeFunctionOnNextCall(f);
assertEquals(["0","1","2"], f("bla"));
@@ -27,15 +28,15 @@ var deopt_has = false;
var deopt_enum = false;
var handler = {
- enumerate: function(target) {
+ enumerate(target) {
if (deopt_enum) {
%DeoptimizeFunction(f2);
deopt_enum = false;
}
- return keys;
+ return keys[Symbol.iterator]();
},
- getPropertyDescriptor: function(k) {
+ has(target, k) {
if (deopt_has) {
%DeoptimizeFunction(f2);
deopt_has = false;
@@ -65,10 +66,12 @@ function check_f2() {
check_f2();
check_f2();
+
// Test lazy deopt after GetPropertyNamesFast
%OptimizeFunctionOnNextCall(f2);
deopt_enum = true;
check_f2();
+
// Test lazy deopt after FILTER_KEY
%OptimizeFunctionOnNextCall(f2);
deopt_has = true;
@@ -81,13 +84,14 @@ function f3(o) {
f3({__proto__:{x:1}});
f3({__proto__:{x:1}});
+
%OptimizeFunctionOnNextCall(f3);
f3(undefined);
f3(null);
// Reliable repro for an issue previously flushed out by GC stress.
var handler2 = {
- getPropertyDescriptor: function(k) {
+ getPropertyDescriptor(target, k) {
has_keys.push(k);
return {value: 10, configurable: true, writable: false, enumerable: true};
}
@@ -104,14 +108,18 @@ function f4(o, p) {
}
return result;
}
+
function check_f4() {
assertEquals(keys, f4(o, p));
assertEquals(keys, has_keys);
has_keys.length = 0;
}
+
check_f4();
check_f4();
+
%OptimizeFunctionOnNextCall(f4);
+
p.y = "y"; // Change map, cause eager deopt.
check_f4();
@@ -128,11 +136,11 @@ function listener(event, exec_state, event_data, data) {
}
var handler3 = {
- enumerate: function(target) {
- return ["a", "b"];
+ enumerate(target) {
+ return ["a", "b"][Symbol.iterator]();
},
- getPropertyDescriptor: function(k) {
+ has(target, k) {
if (k == "a") count++;
if (x) %ScheduleBreak();
return {value: 10, configurable: true, writable: false, enumerable: true};

Powered by Google App Engine
This is Rietveld 408576698