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

Unified Diff: src/v8natives.js

Issue 2051001: Fixed issue 697 allowing Object.create to be called with a function.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 7 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
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-697.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8natives.js
===================================================================
--- src/v8natives.js (revision 4607)
+++ src/v8natives.js (working copy)
@@ -660,7 +660,8 @@
// ES5 section 15.2.3.5.
function ObjectCreate(proto, properties) {
- if (!IS_OBJECT(proto) && !IS_NULL(proto)) {
+ // IS_OBJECT will return true on null covering that case.
+ if (!IS_OBJECT(proto) && !IS_FUNCTION(proto)) {
throw MakeTypeError("proto_object_or_null", [proto]);
}
var obj = new $Object();
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-697.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698