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

Side by Side Diff: src/v8natives.js

Issue 433413002: `1..isPrototypeOf.call(null)` should return false, not throw TypeError. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Patch Set 5 Created 6 years, 4 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 | « no previous file | test/mjsunit/function-call.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file relies on the fact that the following declarations have been made 5 // This file relies on the fact that the following declarations have been made
6 // in runtime.js: 6 // in runtime.js:
7 // var $Object = global.Object; 7 // var $Object = global.Object;
8 // var $Boolean = global.Boolean; 8 // var $Boolean = global.Boolean;
9 // var $Number = global.Number; 9 // var $Number = global.Number;
10 // var $Function = global.Function; 10 // var $Function = global.Function;
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 244
245 var handler = %GetHandler(this); 245 var handler = %GetHandler(this);
246 return CallTrap1(handler, "hasOwn", DerivedHasOwnTrap, ToName(V)); 246 return CallTrap1(handler, "hasOwn", DerivedHasOwnTrap, ToName(V));
247 } 247 }
248 return %HasOwnProperty(TO_OBJECT_INLINE(this), ToName(V)); 248 return %HasOwnProperty(TO_OBJECT_INLINE(this), ToName(V));
249 } 249 }
250 250
251 251
252 // ECMA-262 - 15.2.4.6 252 // ECMA-262 - 15.2.4.6
253 function ObjectIsPrototypeOf(V) { 253 function ObjectIsPrototypeOf(V) {
254 if (!IS_SPEC_OBJECT(V)) return false;
254 CHECK_OBJECT_COERCIBLE(this, "Object.prototype.isPrototypeOf"); 255 CHECK_OBJECT_COERCIBLE(this, "Object.prototype.isPrototypeOf");
255 if (!IS_SPEC_OBJECT(V)) return false;
256 return %IsInPrototypeChain(this, V); 256 return %IsInPrototypeChain(this, V);
257 } 257 }
258 258
259 259
260 // ECMA-262 - 15.2.4.6 260 // ECMA-262 - 15.2.4.6
261 function ObjectPropertyIsEnumerable(V) { 261 function ObjectPropertyIsEnumerable(V) {
262 var P = ToName(V); 262 var P = ToName(V);
263 if (%IsJSProxy(this)) { 263 if (%IsJSProxy(this)) {
264 // TODO(rossberg): adjust once there is a story for symbols vs proxies. 264 // TODO(rossberg): adjust once there is a story for symbols vs proxies.
265 if (IS_SYMBOL(V)) return false; 265 if (IS_SYMBOL(V)) return false;
(...skipping 1645 matching lines...) Expand 10 before | Expand all | Expand 10 after
1911 } 1911 }
1912 if (!IS_SPEC_FUNCTION(method)) { 1912 if (!IS_SPEC_FUNCTION(method)) {
1913 throw MakeTypeError('not_iterable', [obj]); 1913 throw MakeTypeError('not_iterable', [obj]);
1914 } 1914 }
1915 var iterator = %_CallFunction(obj, method); 1915 var iterator = %_CallFunction(obj, method);
1916 if (!IS_SPEC_OBJECT(iterator)) { 1916 if (!IS_SPEC_OBJECT(iterator)) {
1917 throw MakeTypeError('not_an_iterator', [iterator]); 1917 throw MakeTypeError('not_an_iterator', [iterator]);
1918 } 1918 }
1919 return iterator; 1919 return iterator;
1920 } 1920 }
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/function-call.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698