Bug 28114 - [ES5] Implement Object.getPrototypeOf
Summary: [ES5] Implement Object.getPrototypeOf
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2009-08-08 13:45 PDT by Oliver Hunt
Modified: 2009-08-09 03:34 PDT (History)
0 users

See Also:

Patch v1 (10.35 KB, patch)
2009-08-08 13:53 PDT, Oliver Hunt
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Hunt 2009-08-08 13:45:49 PDT
ES5 defines a standard getPrototypeOf in place of __proto__, we should implement this
Comment 1 Oliver Hunt 2009-08-08 13:53:51 PDT
Created attachment 34399 [details]
Patch v1
Comment 2 Eric Seidel (no email) 2009-08-08 17:19:21 PDT
Comment on attachment 34399 [details]
Patch v1

Do we want to guard this in any way?  I don't know how up-in-the-air ES5 is at this point.

Technically this looks fine.

I guess isPrototypeOf was implemented before but just not well tested? (Since I don't see the implementation of isPrototypeOf here.

Since this technically looks fine, and I trust you to make a guarding decision, r+. :)  (I even went and read the spec.)

You might consider adding the spec text to your ChangeLog: Object.getPrototypeOf ( O ) 
When the getPrototypeOf function is called with argument O, the following steps are taken: 
1. If Type(O) is not Object throw a TypeError exception. 
2. Return the value of the [[Prototype]] internal property of O.
Comment 3 Sam Weinig 2009-08-08 17:49:12 PDT
Comment on attachment 34399 [details]
Patch v1

> +static JSValue JSC_HOST_CALL objectConsGetPrototypeOf(ExecState*, JSObject*, JSValue, const ArgList&);

Please don't abbreviate constructor here.  I have tried hard to keep unnecessary abbreviations out of these methods.
Comment 4 Oliver Hunt 2009-08-09 03:34:29 PDT
Committed r46963