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

Side by Side Diff: test/mjsunit/harmony/proxies.js

Issue 1812793002: ES6: Object.setPrototypeOf(func, null) breaks instanceof (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « test/mjsunit/allocation-site-info.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 1011
1012 1012
1013 (function TestInstanceofProxy() { 1013 (function TestInstanceofProxy() {
1014 var o0 = Object.create(null) 1014 var o0 = Object.create(null)
1015 var o1 = {} 1015 var o1 = {}
1016 var o2 = Object.create(o0) 1016 var o2 = Object.create(o0)
1017 var o3 = Object.create(o1) 1017 var o3 = Object.create(o1)
1018 var o4 = Object.create(o2) 1018 var o4 = Object.create(o2)
1019 var o5 = Object.create(o3) 1019 var o5 = Object.create(o3)
1020 1020
1021 function handler(o) { return {get: function() { return o } } } 1021 function handler(o) {
1022 return {
1023 get: function(r, p) {
1024 // We want to test prototype lookup, so ensure the proxy
1025 // offers OrdinaryHasInstance behavior.
1026 if (p === Symbol.hasInstance) {
1027 return undefined;
1028 }
1029 return o;
1030 }
1031 }
1032 }
1033
1022 var f0 = new Proxy(function() {}, handler(o0)) 1034 var f0 = new Proxy(function() {}, handler(o0))
1023 var f1 = new Proxy(function() {}, handler(o1)) 1035 var f1 = new Proxy(function() {}, handler(o1))
1024 var f2 = new Proxy(function() {}, handler(o2)) 1036 var f2 = new Proxy(function() {}, handler(o2))
1025 var f3 = new Proxy(function() {}, handler(o3)) 1037 var f3 = new Proxy(function() {}, handler(o3))
1026 var f4 = new Proxy(function() {}, handler(o4)) 1038 var f4 = new Proxy(function() {}, handler(o4))
1027 var f5 = new Proxy(function() {}, handler(o4)) 1039 var f5 = new Proxy(function() {}, handler(o4))
1028 1040
1029 assertFalse(null instanceof f0) 1041 assertFalse(null instanceof f0)
1030 assertFalse(o0 instanceof f0) 1042 assertFalse(o0 instanceof f0)
1031 assertFalse(o0 instanceof f1) 1043 assertFalse(o0 instanceof f1)
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
1485 var o = new C(); 1497 var o = new C();
1486 1498
1487 function f() { 1499 function f() {
1488 return o.x; 1500 return o.x;
1489 } 1501 }
1490 assertEquals(10, f()); 1502 assertEquals(10, f());
1491 assertEquals(10, f()); 1503 assertEquals(10, f());
1492 %OptimizeFunctionOnNextCall(f); 1504 %OptimizeFunctionOnNextCall(f);
1493 assertEquals(10, f()); 1505 assertEquals(10, f());
1494 })(); 1506 })();
OLDNEW
« no previous file with comments | « test/mjsunit/allocation-site-info.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698