[webkit-reviews] review granted: [Bug 115542] Rationalized 'this' value conversion : [Attachment 200551] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 6 10:19:54 PDT 2013


Oliver Hunt <oliver at apple.com> has granted Geoffrey Garen <ggaren at apple.com>'s
request for review:
Bug 115542: Rationalized 'this' value conversion
https://bugs.webkit.org/show_bug.cgi?id=115542

Attachment 200551: Patch
https://bugs.webkit.org/attachment.cgi?id=200551&action=review

------- Additional Comments from Oliver Hunt <oliver at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=200551&action=review


> Source/JavaScriptCore/runtime/GetterSetter.cpp:61
> +
> +    // Unlike other function calls, getter calls are specified to ToObject
their base
> +    // at the call site.
> +    JSValue thisValue = base.toThis(exec, NotStrictMode);

Really?  Seems fairly dumb behavior to me :-/

> Source/JavaScriptCore/runtime/JSActivation.cpp:235
> +JSValue JSActivation::toThis(JSCell*, ExecState* exec, ECMAMode ecmaMode)
>  {
> +    if (ecmaMode == StrictMode)
> +	   return jsUndefined();
>      return exec->globalThisValue();

May be faster to simply have this use this->globalObject() ?

> Source/JavaScriptCore/runtime/JSCJSValue.cpp:88
> +    if (ecmaMode == StrictMode)
> +	   return *this;

What if we're the global object?  we should be returning the proxy - how is
this handled?


More information about the webkit-reviews mailing list