Changeset 208410 in webkit
- Timestamp:
- Nov 4, 2016 5:48:01 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r208404 r208410 1 2016-11-04 Mark Lam <mark.lam@apple.com> 2 3 Error description code should be able to handle Symbol values. 4 https://bugs.webkit.org/show_bug.cgi?id=164436 5 <rdar://problem/29115583> 6 7 Reviewed by Filip Pizlo and Saam Barati. 8 9 * stress/error-description-on-symbols-should-not-crash.js: Added. 10 1 11 2016-11-03 Geoffrey Garen <ggaren@apple.com> 2 12 -
trunk/Source/JavaScriptCore/ChangeLog
r208404 r208410 1 2016-11-04 Mark Lam <mark.lam@apple.com> 2 3 Error description code should be able to handle Symbol values. 4 https://bugs.webkit.org/show_bug.cgi?id=164436 5 <rdar://problem/29115583> 6 7 Reviewed by Filip Pizlo and Saam Barati. 8 9 Previously, we try to toString() the Symbol value, resulting in it throwing an 10 exception in errorDescriptionForValue() which breaks the invariant that 11 errorDescriptionForValue() should not throw. 12 13 We fixed this by making errorDescriptionForValue() aware of the Symbol type, and 14 not so a toString() on Symbol values. Also fixed notAFunctionSourceAppender() 15 to build a nicer message for Symbol values. 16 17 * runtime/ExceptionHelpers.cpp: 18 (JSC::errorDescriptionForValue): 19 (JSC::notAFunctionSourceAppender): 20 1 21 2016-11-02 Geoffrey Garen <ggaren@apple.com> 2 22 -
trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp
r207825 r208410 87 87 if (v.isString()) 88 88 return jsNontrivialString(exec, makeString('"', asString(v)->value(exec), '"')); 89 if (v.isSymbol()) 90 return jsNontrivialString(exec, asSymbol(v)->descriptiveString()); 89 91 if (v.isObject()) { 90 92 CallData callData; … … 183 185 builder.append(base); 184 186 builder.appendLiteral("' is "); 185 if (type == TypeObject) 186 builder.appendLiteral("an instance of "); 187 builder.append(displayValue); 187 if (type == TypeSymbol) 188 builder.appendLiteral("a Symbol"); 189 else { 190 if (type == TypeObject) 191 builder.appendLiteral("an instance of "); 192 builder.append(displayValue); 193 } 188 194 builder.append(')'); 189 195
Note: See TracChangeset
for help on using the changeset viewer.