Index: src/v8natives.js |
=================================================================== |
--- src/v8natives.js (revision 3552) |
+++ src/v8natives.js (working copy) |
@@ -448,6 +448,15 @@ |
} |
+// ES5 section 15.2.3.2. |
+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)) { |
@@ -512,7 +521,8 @@ |
)); |
InstallFunctions($Object, DONT_ENUM, $Array( |
"keys", ObjectKeys, |
- "create", ObjectCreate |
+ "create", ObjectCreate, |
+ "getPrototypeOf", ObjectGetPrototypeOf |
)); |
} |