File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -194,7 +194,7 @@ using namespace Js;
194
194
// ii. Let nextp be the result of calling the [[GetInheritance]] internal method of p with no arguments.
195
195
// iii. ReturnIfAbrupt(nextp).
196
196
// iv. Let p be nextp.
197
- if (IsPrototypeOf (object, newPrototype, scriptContext)) // Reject cycle
197
+ if (IsPrototypeOfStopAtProxy (object, newPrototype, scriptContext)) // Reject cycle
198
198
{
199
199
if (shouldThrow)
200
200
{
Original file line number Diff line number Diff line change @@ -137,6 +137,23 @@ var tests = [
137
137
new bar ( ...( new Array ( 2 ** 16 + 1 ) ) )
138
138
} catch ( e ) { }
139
139
}
140
+ } ,
141
+ {
142
+ name : "getPrototypeOf Should not be called when set as prototype" ,
143
+ body : function ( ) {
144
+ var p = new Proxy ( { } , { getPrototypeOf : function ( ) {
145
+ assert . fail ( "this should not be called" )
146
+ return { } ;
147
+ } } ) ;
148
+
149
+ var obj = { } ;
150
+ obj . __proto__ = p ; // This should not call the getPrototypeOf
151
+
152
+ var obj1 = { } ;
153
+ Object . setPrototypeOf ( obj1 , p ) ; // This should not call the getPrototypeOf
154
+
155
+ var obj2 = { __proto__ : p } ; // This should not call the getPrototypeOf
156
+ }
140
157
}
141
158
142
159
] ;
You can’t perform that action at this time.
0 commit comments