Bug 161275 - Fix toStringName for Proxies and add support for normal instances
Summary: Fix toStringName for Proxies and add support for normal instances
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Keith Miller
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-26 16:11 PDT by Keith Miller
Modified: 2016-08-29 11:52 PDT (History)
4 users (show)

See Also:


Attachments
Patch (15.79 KB, patch)
2016-08-26 16:22 PDT, Keith Miller
no flags Details | Formatted Diff | Diff
Patch (15.77 KB, patch)
2016-08-26 16:32 PDT, Keith Miller
no flags Details | Formatted Diff | Diff
Patch for landing (15.78 KB, patch)
2016-08-29 11:21 PDT, Keith Miller
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Miller 2016-08-26 16:11:54 PDT
Fix toStringName for Proxies and add support for normal instances
Comment 1 Keith Miller 2016-08-26 16:22:52 PDT
Created attachment 287170 [details]
Patch
Comment 2 Keith Miller 2016-08-26 16:32:18 PDT
Created attachment 287172 [details]
Patch
Comment 3 Saam Barati 2016-08-26 18:13:51 PDT
Comment on attachment 287172 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=287172&action=review

> Source/JavaScriptCore/runtime/ObjectPrototype.cpp:301
> +        String&& tag = thisObject->methodTable(exec->vm())->toStringName(thisObject, exec);

Why the && here?
Why not just do:
String tag = ...;
...
String newString = WTF::tryMakeString("[object ", WTFMove(tag), "]");
...
Comment 4 Keith Miller 2016-08-29 11:17:29 PDT
Comment on attachment 287172 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=287172&action=review

>> Source/JavaScriptCore/runtime/ObjectPrototype.cpp:301
>> +        String&& tag = thisObject->methodTable(exec->vm())->toStringName(thisObject, exec);
> 
> Why the && here?
> Why not just do:
> String tag = ...;
> ...
> String newString = WTF::tryMakeString("[object ", WTFMove(tag), "]");
> ...

Yeah, I dunno why I did it this way. I'll switch.
Comment 5 Keith Miller 2016-08-29 11:21:45 PDT
Created attachment 287285 [details]
Patch for landing
Comment 6 WebKit Commit Bot 2016-08-29 11:52:34 PDT
Comment on attachment 287285 [details]
Patch for landing

Clearing flags on attachment: 287285

Committed r205131: <http://trac.webkit.org/changeset/205131>
Comment 7 WebKit Commit Bot 2016-08-29 11:52:41 PDT
All reviewed patches have been landed.  Closing bug.