Ignore:
Timestamp:
Oct 10, 2012, 11:08:03 AM (13 years ago)
Author:
[email protected]
Message:

After r130344, OpaqueJSString::string() shouldn't directly return the wrapped String
https://bugs.webkit.org/show_bug.cgi?id=98801

Reviewed by Geoffrey Garen.

Return a copy of the wrapped String so that the wrapped string cannot be turned into
an Identifier.

  • API/OpaqueJSString.cpp:

(OpaqueJSString::string):

  • API/OpaqueJSString.h:

(OpaqueJSString):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/OpaqueJSString.cpp

    r130761 r130931  
    4040}
    4141
     42String OpaqueJSString::string() const
     43{
     44    if (!this)
     45        return String();
     46
     47    // Return a copy of the wrapped string, because the caller may make it an Identifier.
     48    return m_string.isolatedCopy();
     49}
     50
    4251Identifier OpaqueJSString::identifier(JSGlobalData* globalData) const
    4352{
Note: See TracChangeset for help on using the changeset viewer.