Changeset 207851 in webkit
- Timestamp:
- Oct 25, 2016, 3:30:08 PM (8 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r207849 r207851 1 2016-10-25 Mark Lam <mark.lam@apple.com> 2 3 Add ThrowScope::release() calls at all call sites of jsMakeNontrivialString(). 4 https://bugs.webkit.org/show_bug.cgi?id=163990 5 6 Reviewed by Geoffrey Garen. 7 8 * runtime/ArrayPrototype.cpp: 9 (JSC::arrayProtoFuncToString): 10 * runtime/ErrorPrototype.cpp: 11 (JSC::errorProtoFuncToString): 12 * runtime/FunctionPrototype.cpp: 13 (JSC::functionProtoFuncToString): 14 * runtime/RegExpPrototype.cpp: 15 (JSC::regExpProtoFuncToString): 16 * runtime/StringPrototype.cpp: 17 (JSC::stringProtoFuncBig): 18 (JSC::stringProtoFuncSmall): 19 (JSC::stringProtoFuncBlink): 20 (JSC::stringProtoFuncBold): 21 (JSC::stringProtoFuncFixed): 22 (JSC::stringProtoFuncItalics): 23 (JSC::stringProtoFuncStrike): 24 (JSC::stringProtoFuncSub): 25 (JSC::stringProtoFuncSup): 26 (JSC::stringProtoFuncFontcolor): 27 (JSC::stringProtoFuncFontsize): 28 (JSC::stringProtoFuncAnchor): 29 1 30 2016-10-25 Mark Lam <mark.lam@apple.com> 2 31 -
trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
r207411 r207851 373 373 customJoinCase = true; 374 374 375 if (UNLIKELY(customJoinCase)) 375 if (UNLIKELY(customJoinCase)) { 376 scope.release(); 376 377 return JSValue::encode(jsMakeNontrivialString(exec, "[object ", thisObject->methodTable(vm)->className(thisObject), "]")); 378 } 377 379 378 380 // 4. Return the result of calling the [[Call]] internal method of func providing array as the this value and an empty arguments list. -
trunk/Source/JavaScriptCore/runtime/ErrorPrototype.cpp
r206386 r207851 121 121 122 122 // 10. Return the result of concatenating name, ":", a single space character, and msg. 123 scope.release(); 123 124 return JSValue::encode(jsMakeNontrivialString(exec, nameString, ": ", messageString)); 124 125 } -
trunk/Source/JavaScriptCore/runtime/FunctionPrototype.cpp
r206267 r207851 95 95 if (thisValue.inherits(JSFunction::info())) { 96 96 JSFunction* function = jsCast<JSFunction*>(thisValue); 97 if (function->isHostOrBuiltinFunction()) 97 if (function->isHostOrBuiltinFunction()) { 98 scope.release(); 98 99 return JSValue::encode(jsMakeNontrivialString(exec, "function ", function->name(vm), "() {\n [native code]\n}")); 100 } 99 101 100 102 FunctionExecutable* executable = function->jsExecutable(); … … 109 111 executable->parametersStartOffset(), 110 112 executable->parametersStartOffset() + executable->source().length()); 113 scope.release(); 111 114 return JSValue::encode(jsMakeNontrivialString(exec, functionHeader, function->name(vm), source)); 112 115 } … … 114 117 if (thisValue.inherits(InternalFunction::info())) { 115 118 InternalFunction* function = asInternalFunction(thisValue); 119 scope.release(); 116 120 return JSValue::encode(jsMakeNontrivialString(exec, "function ", function->name(), "() {\n [native code]\n}")); 117 121 } … … 122 126 CallData callData; 123 127 if (object->methodTable(vm)->getCallData(object, callData) != CallType::None) { 124 if (auto* classInfo = object->classInfo()) 128 if (auto* classInfo = object->classInfo()) { 129 scope.release(); 125 130 return JSValue::encode(jsMakeNontrivialString(exec, "function ", classInfo->className, "() {\n [native code]\n}")); 131 } 126 132 } 127 133 } -
trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp
r207334 r207851 242 242 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 243 243 244 scope.release(); 244 245 return JSValue::encode(jsMakeNontrivialString(exec, '/', source, '/', flags)); 245 246 } -
trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp
r207652 r207851 1498 1498 String s = thisValue.toString(exec)->value(exec); 1499 1499 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 1500 scope.release(); 1500 1501 return JSValue::encode(jsMakeNontrivialString(exec, "<big>", s, "</big>")); 1501 1502 } … … 1511 1512 String s = thisValue.toString(exec)->value(exec); 1512 1513 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 1514 scope.release(); 1513 1515 return JSValue::encode(jsMakeNontrivialString(exec, "<small>", s, "</small>")); 1514 1516 } … … 1524 1526 String s = thisValue.toString(exec)->value(exec); 1525 1527 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 1528 scope.release(); 1526 1529 return JSValue::encode(jsMakeNontrivialString(exec, "<blink>", s, "</blink>")); 1527 1530 } … … 1537 1540 String s = thisValue.toString(exec)->value(exec); 1538 1541 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 1542 scope.release(); 1539 1543 return JSValue::encode(jsMakeNontrivialString(exec, "<b>", s, "</b>")); 1540 1544 } … … 1550 1554 String s = thisValue.toString(exec)->value(exec); 1551 1555 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 1556 scope.release(); 1552 1557 return JSValue::encode(jsMakeNontrivialString(exec, "<tt>", s, "</tt>")); 1553 1558 } … … 1563 1568 String s = thisValue.toString(exec)->value(exec); 1564 1569 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 1570 scope.release(); 1565 1571 return JSValue::encode(jsMakeNontrivialString(exec, "<i>", s, "</i>")); 1566 1572 } … … 1576 1582 String s = thisValue.toString(exec)->value(exec); 1577 1583 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 1584 scope.release(); 1578 1585 return JSValue::encode(jsMakeNontrivialString(exec, "<strike>", s, "</strike>")); 1579 1586 } … … 1589 1596 String s = thisValue.toString(exec)->value(exec); 1590 1597 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 1598 scope.release(); 1591 1599 return JSValue::encode(jsMakeNontrivialString(exec, "<sub>", s, "</sub>")); 1592 1600 } … … 1602 1610 String s = thisValue.toString(exec)->value(exec); 1603 1611 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 1612 scope.release(); 1604 1613 return JSValue::encode(jsMakeNontrivialString(exec, "<sup>", s, "</sup>")); 1605 1614 } … … 1620 1629 color.replaceWithLiteral('"', """); 1621 1630 1631 scope.release(); 1622 1632 return JSValue::encode(jsMakeNontrivialString(exec, "<font color=\"", color, "\">", s, "</font>")); 1623 1633 } … … 1674 1684 fontSize.replaceWithLiteral('"', """); 1675 1685 1686 scope.release(); 1676 1687 return JSValue::encode(jsMakeNontrivialString(exec, "<font size=\"", fontSize, "\">", s, "</font>")); 1677 1688 } … … 1692 1703 anchor.replaceWithLiteral('"', """); 1693 1704 1705 scope.release(); 1694 1706 return JSValue::encode(jsMakeNontrivialString(exec, "<a name=\"", anchor, "\">", s, "</a>")); 1695 1707 }
Note:
See TracChangeset
for help on using the changeset viewer.