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

Unified Diff: src/v8natives.js

Issue 518056: Added ES5 15.2.3.2 Object.getPrototypeOf. (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: '' Created 10 years, 11 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
Index: src/v8natives.js
===================================================================
--- src/v8natives.js (revision 3543)
+++ src/v8natives.js (working copy)
@@ -449,6 +449,15 @@
// ES5 section 15.2.3.5.
+function ObjectGetPrototypeOf(obj) {
+ if (!(IS_OBJECT(obj) || IS_FUNCTION(obj))) {
+ throw MakeTypeError("object_get_prototype_non_object", [obj]);
+ }
+ return obj.__proto__;
+}
+
+
+// ES5 section 15.2.3.5.
function ObjectCreate(proto, properties) {
if (!IS_OBJECT(proto) && !IS_NULL(proto)) {
throw MakeTypeError("proto_object_or_null", [proto]);
@@ -512,7 +521,8 @@
));
InstallFunctions($Object, DONT_ENUM, $Array(
"keys", ObjectKeys,
- "create", ObjectCreate
+ "create", ObjectCreate,
+ "getPrototypeOf", ObjectGetPrototypeOf
));
}
« no previous file with comments | « src/messages.js ('k') | test/es5conform/es5conform.status » ('j') | tools/presubmit.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698