<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[202890] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/202890">202890</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2016-07-06 20:12:37 -0700 (Wed, 06 Jul 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>[JSC] Unify how we throw TypeError from C++
https://bugs.webkit.org/show_bug.cgi?id=159500
Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-07-06
Reviewed by Saam Barati.
Source/JavaScriptCore:
Throwing a TypeError is an uncommon case. We should minimize the impact
on the call sites.
This patch does that by:
-Replace the 2 calls createTypeError()->throwException() by throwTypeError().
-Use ASCIILiteral when possible.
-Add an overload of throwTypeError() taking ASCIILiteral directly
(that way, the String creation and destruction is done by the callee).
On x86_64, this reduces the __TEXT__ segment by 29kb.
* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::evaluateWithScopeExtension):
* inspector/JSJavaScriptCallFrame.cpp:
(Inspector::JSJavaScriptCallFrame::evaluateWithScopeExtension):
* interpreter/Interpreter.cpp:
(JSC::Interpreter::execute):
* jit/JITOperations.cpp:
* runtime/DatePrototype.cpp:
(JSC::dateProtoFuncToJSON):
* runtime/Error.cpp:
(JSC::throwConstructorCannotBeCalledAsFunctionTypeError):
(JSC::throwTypeError):
* runtime/Error.h:
(JSC::throwVMTypeError):
* runtime/JSArrayBufferPrototype.cpp:
(JSC::arrayBufferProtoFuncSlice):
* runtime/JSCJSValue.cpp:
(JSC::JSValue::putToPrimitive):
(JSC::JSValue::toStringSlowCase):
* runtime/JSCJSValueInlines.h:
(JSC::toPreferredPrimitiveType):
* runtime/JSDataViewPrototype.cpp:
(JSC::getData):
(JSC::setData):
* runtime/JSFunction.cpp:
(JSC::JSFunction::defineOwnProperty):
* runtime/JSGenericTypedArrayViewConstructorInlines.h:
(JSC::constructGenericTypedArrayViewFromIterator):
(JSC::constructGenericTypedArrayViewWithArguments):
(JSC::constructGenericTypedArrayView):
* runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
(JSC::speciesConstruct):
(JSC::genericTypedArrayViewProtoFuncSet):
(JSC::genericTypedArrayViewProtoFuncCopyWithin):
(JSC::genericTypedArrayViewProtoFuncIndexOf):
(JSC::genericTypedArrayViewProtoFuncLastIndexOf):
(JSC::genericTypedArrayViewProtoFuncSubarray):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncProtoGetter):
(JSC::globalFuncProtoSetter):
* runtime/JSONObject.cpp:
(JSC::Stringifier::appendStringifiedValue):
* runtime/JSObject.cpp:
(JSC::JSObject::setPrototypeWithCycleCheck):
(JSC::callToPrimitiveFunction):
(JSC::JSObject::ordinaryToPrimitive):
(JSC::JSObject::defaultHasInstance):
(JSC::validateAndApplyPropertyDescriptor):
* runtime/JSTypedArrayViewConstructor.cpp:
(JSC::constructTypedArrayView):
* runtime/JSTypedArrayViewPrototype.cpp:
(JSC::typedArrayViewPrivateFuncLength):
(JSC::typedArrayViewProtoFuncSet):
(JSC::typedArrayViewProtoFuncCopyWithin):
(JSC::typedArrayViewProtoFuncFill):
(JSC::typedArrayViewProtoFuncLastIndexOf):
(JSC::typedArrayViewProtoFuncIndexOf):
(JSC::typedArrayViewProtoFuncJoin):
(JSC::typedArrayViewProtoGetterFuncBuffer):
(JSC::typedArrayViewProtoGetterFuncLength):
(JSC::typedArrayViewProtoGetterFuncByteLength):
(JSC::typedArrayViewProtoGetterFuncByteOffset):
(JSC::typedArrayViewProtoFuncReverse):
(JSC::typedArrayViewProtoFuncSubarray):
(JSC::typedArrayViewProtoFuncSlice):
* runtime/ObjectConstructor.cpp:
(JSC::toPropertyDescriptor):
(JSC::objectConstructorDefineProperty):
(JSC::objectConstructorDefineProperties):
(JSC::objectConstructorCreate):
* runtime/ObjectPrototype.cpp:
(JSC::objectProtoFuncDefineGetter):
(JSC::objectProtoFuncDefineSetter):
* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoFuncCompile):
* runtime/Symbol.cpp:
(JSC::Symbol::toNumber):
Source/WebCore:
* bindings/js/JSBiquadFilterNodeCustom.cpp:
(WebCore::JSBiquadFilterNode::setType):
* bindings/js/JSBlobCustom.cpp:
(WebCore::constructJSBlob):
* bindings/js/JSCryptoKeySerializationJWK.cpp:
(WebCore::getBigIntegerVectorFromJSON):
(WebCore::JSCryptoKeySerializationJWK::JSCryptoKeySerializationJWK):
(WebCore::tryJWKKeyOpsValue):
(WebCore::JSCryptoKeySerializationJWK::reconcileUsages):
(WebCore::JSCryptoKeySerializationJWK::keyDataOctetSequence):
(WebCore::JSCryptoKeySerializationJWK::keyDataRSAComponents):
(WebCore::JSCryptoKeySerializationJWK::keyData):
(WebCore::addJWKAlgorithmToJSON):
(WebCore::JSCryptoKeySerializationJWK::serialize):
* bindings/js/JSCryptoOperationData.cpp:
(WebCore::cryptoOperationDataFromJSValue):
* bindings/js/JSDOMBinding.cpp:
(WebCore::enforceRange):
(WebCore::throwTypeError):
(WebCore::throwArgumentMustBeEnumError):
(WebCore::throwArgumentMustBeFunctionError):
(WebCore::throwArgumentTypeError):
(WebCore::throwArrayElementTypeError):
(WebCore::throwGetterTypeError):
(WebCore::throwThisTypeError):
* bindings/js/JSDataCueCustom.cpp:
(WebCore::constructJSDataCue):
* bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::defineElement):
* bindings/js/JSFileCustom.cpp:
(WebCore::constructJSFile):
* bindings/js/JSModuleLoader.cpp:
(WebCore::JSModuleLoader::evaluate):
* bindings/js/JSMutationObserverCustom.cpp:
(WebCore::constructJSMutationObserver):
* bindings/js/JSOscillatorNodeCustom.cpp:
(WebCore::JSOscillatorNode::setType):
* bindings/js/JSPannerNodeCustom.cpp:
(WebCore::JSPannerNode::setPanningModel):
(WebCore::JSPannerNode::setDistanceModel):
* bindings/js/JSReadableStreamPrivateConstructors.cpp:
(WebCore::constructJSReadableStreamController):
(WebCore::constructJSReadableStreamReader):
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::cryptoKeyFormatFromJSValue):
(WebCore::importKey):
(WebCore::exportKey):
* bindings/js/ReadableStreamController.cpp:
(WebCore::ReadableStreamController::invoke):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::throwValidationError):
(WebCore::SerializedScriptValue::maybeThrowExceptionIfSerializationFailed):
* bridge/c/c_instance.cpp:
(JSC::Bindings::CInstance::invokeMethod):
* bridge/objc/objc_instance.mm:
(ObjcInstance::invokeMethod):
* bridge/objc/objc_runtime.mm:
(JSC::Bindings::ObjcArray::setValueAt):
Source/WebKit/mac:
* Plugins/Hosted/ProxyInstance.mm:
(WebKit::ProxyInstance::invokeMethod):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSInjectedScriptHostcpp">trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSJavaScriptCallFramecpp">trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterInterpretercpp">trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOperationscpp">trunk/Source/JavaScriptCore/jit/JITOperations.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeDatePrototypecpp">trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeErrorcpp">trunk/Source/JavaScriptCore/runtime/Error.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeErrorh">trunk/Source/JavaScriptCore/runtime/Error.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSArrayBufferPrototypecpp">trunk/Source/JavaScriptCore/runtime/JSArrayBufferPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSCJSValuecpp">trunk/Source/JavaScriptCore/runtime/JSCJSValue.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSCJSValueInlinesh">trunk/Source/JavaScriptCore/runtime/JSCJSValueInlines.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSDataViewPrototypecpp">trunk/Source/JavaScriptCore/runtime/JSDataViewPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSFunctioncpp">trunk/Source/JavaScriptCore/runtime/JSFunction.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGenericTypedArrayViewConstructorInlinesh">trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGenericTypedArrayViewPrototypeFunctionsh">trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjectFunctionscpp">trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSONObjectcpp">trunk/Source/JavaScriptCore/runtime/JSONObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSObjectcpp">trunk/Source/JavaScriptCore/runtime/JSObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSTypedArrayViewConstructorcpp">trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSTypedArrayViewPrototypecpp">trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeObjectConstructorcpp">trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeObjectPrototypecpp">trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeRegExpPrototypecpp">trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeSymbolcpp">trunk/Source/JavaScriptCore/runtime/Symbol.cpp</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSBiquadFilterNodeCustomcpp">trunk/Source/WebCore/bindings/js/JSBiquadFilterNodeCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSBlobCustomcpp">trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCryptoKeySerializationJWKcpp">trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCryptoOperationDatacpp">trunk/Source/WebCore/bindings/js/JSCryptoOperationData.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingcpp">trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDataCueCustomcpp">trunk/Source/WebCore/bindings/js/JSDataCueCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDocumentCustomcpp">trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSFileCustomcpp">trunk/Source/WebCore/bindings/js/JSFileCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSModuleLoadercpp">trunk/Source/WebCore/bindings/js/JSModuleLoader.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSMutationObserverCustomcpp">trunk/Source/WebCore/bindings/js/JSMutationObserverCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSOscillatorNodeCustomcpp">trunk/Source/WebCore/bindings/js/JSOscillatorNodeCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSPannerNodeCustomcpp">trunk/Source/WebCore/bindings/js/JSPannerNodeCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSReadableStreamPrivateConstructorscpp">trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSSubtleCryptoCustomcpp">trunk/Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsReadableStreamControllercpp">trunk/Source/WebCore/bindings/js/ReadableStreamController.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsSerializedScriptValuecpp">trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp</a></li>
<li><a href="#trunkSourceWebCorebridgecc_instancecpp">trunk/Source/WebCore/bridge/c/c_instance.cpp</a></li>
<li><a href="#trunkSourceWebCorebridgeobjcobjc_instancemm">trunk/Source/WebCore/bridge/objc/objc_instance.mm</a></li>
<li><a href="#trunkSourceWebCorebridgeobjcobjc_runtimemm">trunk/Source/WebCore/bridge/objc/objc_runtime.mm</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacPluginsHostedProxyInstancemm">trunk/Source/WebKit/mac/Plugins/Hosted/ProxyInstance.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -1,3 +1,99 @@
</span><ins>+2016-07-06 Benjamin Poulain <bpoulain@apple.com>
+
+ [JSC] Unify how we throw TypeError from C++
+ https://bugs.webkit.org/show_bug.cgi?id=159500
+
+ Reviewed by Saam Barati.
+
+ Throwing a TypeError is an uncommon case. We should minimize the impact
+ on the call sites.
+
+ This patch does that by:
+ -Replace the 2 calls createTypeError()->throwException() by throwTypeError().
+ -Use ASCIILiteral when possible.
+ -Add an overload of throwTypeError() taking ASCIILiteral directly
+ (that way, the String creation and destruction is done by the callee).
+
+ On x86_64, this reduces the __TEXT__ segment by 29kb.
+
+ * inspector/JSInjectedScriptHost.cpp:
+ (Inspector::JSInjectedScriptHost::evaluateWithScopeExtension):
+ * inspector/JSJavaScriptCallFrame.cpp:
+ (Inspector::JSJavaScriptCallFrame::evaluateWithScopeExtension):
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::execute):
+ * jit/JITOperations.cpp:
+ * runtime/DatePrototype.cpp:
+ (JSC::dateProtoFuncToJSON):
+ * runtime/Error.cpp:
+ (JSC::throwConstructorCannotBeCalledAsFunctionTypeError):
+ (JSC::throwTypeError):
+ * runtime/Error.h:
+ (JSC::throwVMTypeError):
+ * runtime/JSArrayBufferPrototype.cpp:
+ (JSC::arrayBufferProtoFuncSlice):
+ * runtime/JSCJSValue.cpp:
+ (JSC::JSValue::putToPrimitive):
+ (JSC::JSValue::toStringSlowCase):
+ * runtime/JSCJSValueInlines.h:
+ (JSC::toPreferredPrimitiveType):
+ * runtime/JSDataViewPrototype.cpp:
+ (JSC::getData):
+ (JSC::setData):
+ * runtime/JSFunction.cpp:
+ (JSC::JSFunction::defineOwnProperty):
+ * runtime/JSGenericTypedArrayViewConstructorInlines.h:
+ (JSC::constructGenericTypedArrayViewFromIterator):
+ (JSC::constructGenericTypedArrayViewWithArguments):
+ (JSC::constructGenericTypedArrayView):
+ * runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
+ (JSC::speciesConstruct):
+ (JSC::genericTypedArrayViewProtoFuncSet):
+ (JSC::genericTypedArrayViewProtoFuncCopyWithin):
+ (JSC::genericTypedArrayViewProtoFuncIndexOf):
+ (JSC::genericTypedArrayViewProtoFuncLastIndexOf):
+ (JSC::genericTypedArrayViewProtoFuncSubarray):
+ * runtime/JSGlobalObjectFunctions.cpp:
+ (JSC::globalFuncProtoGetter):
+ (JSC::globalFuncProtoSetter):
+ * runtime/JSONObject.cpp:
+ (JSC::Stringifier::appendStringifiedValue):
+ * runtime/JSObject.cpp:
+ (JSC::JSObject::setPrototypeWithCycleCheck):
+ (JSC::callToPrimitiveFunction):
+ (JSC::JSObject::ordinaryToPrimitive):
+ (JSC::JSObject::defaultHasInstance):
+ (JSC::validateAndApplyPropertyDescriptor):
+ * runtime/JSTypedArrayViewConstructor.cpp:
+ (JSC::constructTypedArrayView):
+ * runtime/JSTypedArrayViewPrototype.cpp:
+ (JSC::typedArrayViewPrivateFuncLength):
+ (JSC::typedArrayViewProtoFuncSet):
+ (JSC::typedArrayViewProtoFuncCopyWithin):
+ (JSC::typedArrayViewProtoFuncFill):
+ (JSC::typedArrayViewProtoFuncLastIndexOf):
+ (JSC::typedArrayViewProtoFuncIndexOf):
+ (JSC::typedArrayViewProtoFuncJoin):
+ (JSC::typedArrayViewProtoGetterFuncBuffer):
+ (JSC::typedArrayViewProtoGetterFuncLength):
+ (JSC::typedArrayViewProtoGetterFuncByteLength):
+ (JSC::typedArrayViewProtoGetterFuncByteOffset):
+ (JSC::typedArrayViewProtoFuncReverse):
+ (JSC::typedArrayViewProtoFuncSubarray):
+ (JSC::typedArrayViewProtoFuncSlice):
+ * runtime/ObjectConstructor.cpp:
+ (JSC::toPropertyDescriptor):
+ (JSC::objectConstructorDefineProperty):
+ (JSC::objectConstructorDefineProperties):
+ (JSC::objectConstructorCreate):
+ * runtime/ObjectPrototype.cpp:
+ (JSC::objectProtoFuncDefineGetter):
+ (JSC::objectProtoFuncDefineSetter):
+ * runtime/RegExpPrototype.cpp:
+ (JSC::regExpProtoFuncCompile):
+ * runtime/Symbol.cpp:
+ (JSC::Symbol::toNumber):
+
</ins><span class="cx"> 2016-07-06 Saam Barati <sbarati@apple.com>
</span><span class="cx">
</span><span class="cx"> InlineAccess::sizeForLengthAccess() is wrong on some platforms because it should also consider "length" not being array length
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSInjectedScriptHostcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -97,7 +97,7 @@
</span><span class="cx"> {
</span><span class="cx"> JSValue scriptValue = exec->argument(0);
</span><span class="cx"> if (!scriptValue.isString())
</span><del>- return throwTypeError(exec, "InjectedScriptHost.evaluateWithScopeExtension first argument must be a string.");
</del><ins>+ return throwTypeError(exec, ASCIILiteral("InjectedScriptHost.evaluateWithScopeExtension first argument must be a string."));
</ins><span class="cx">
</span><span class="cx"> String program = scriptValue.toString(exec)->value(exec);
</span><span class="cx"> if (exec->hadException())
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSJavaScriptCallFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx"> {
</span><span class="cx"> JSValue scriptValue = exec->argument(0);
</span><span class="cx"> if (!scriptValue.isString())
</span><del>- return throwTypeError(exec, "JSJavaScriptCallFrame.evaluateWithScopeExtension first argument must be a string.");
</del><ins>+ return throwTypeError(exec, ASCIILiteral("JSJavaScriptCallFrame.evaluateWithScopeExtension first argument must be a string."));
</ins><span class="cx">
</span><span class="cx"> String script = scriptValue.toString(exec)->value(exec);
</span><span class="cx"> if (exec->hadException())
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterInterpretercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -1185,8 +1185,7 @@
</span><span class="cx"> const Identifier& ident = codeBlock->variable(i);
</span><span class="cx"> PropertySlot slot(globalLexicalEnvironment, PropertySlot::InternalMethodType::VMInquiry);
</span><span class="cx"> if (JSGlobalLexicalEnvironment::getOwnPropertySlot(globalLexicalEnvironment, callFrame, ident, slot)) {
</span><del>- return checkedReturn(callFrame->vm().throwException(callFrame,
- createTypeError(callFrame, makeString("Can't create duplicate global variable in eval: '", String(ident.impl()), "'"))));
</del><ins>+ return checkedReturn(throwTypeError(callFrame, makeString("Can't create duplicate global variable in eval: '", String(ident.impl()), "'")));
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1194,8 +1193,7 @@
</span><span class="cx"> FunctionExecutable* function = codeBlock->functionDecl(i);
</span><span class="cx"> PropertySlot slot(globalLexicalEnvironment, PropertySlot::InternalMethodType::VMInquiry);
</span><span class="cx"> if (JSGlobalLexicalEnvironment::getOwnPropertySlot(globalLexicalEnvironment, callFrame, function->name(), slot)) {
</span><del>- return checkedReturn(callFrame->vm().throwException(callFrame,
- createTypeError(callFrame, makeString("Can't create duplicate global variable in eval: '", String(function->name().impl()), "'"))));
</del><ins>+ return checkedReturn(throwTypeError(callFrame, makeString("Can't create duplicate global variable in eval: '", String(function->name().impl()), "'")));
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOperations.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -1172,7 +1172,7 @@
</span><span class="cx"> if (referenceErrorFlag)
</span><span class="cx"> vm.throwException(exec, createReferenceError(exec, errorMessage));
</span><span class="cx"> else
</span><del>- vm.throwException(exec, createTypeError(exec, errorMessage));
</del><ins>+ throwTypeError(exec, errorMessage);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void JIT_OPERATION operationDebug(ExecState* exec, int32_t debugHookID)
</span><span class="lines">@@ -1873,7 +1873,7 @@
</span><span class="cx"> return false;
</span><span class="cx"> bool couldDelete = baseObj->methodTable(vm)->deleteProperty(baseObj, exec, Identifier::fromUid(&vm, uid));
</span><span class="cx"> if (!couldDelete && exec->codeBlock()->isStrictMode())
</span><del>- vm.throwException(exec, createTypeError(exec, ASCIILiteral("Unable to delete property.")));
</del><ins>+ throwTypeError(exec, ASCIILiteral("Unable to delete property."));
</ins><span class="cx"> return couldDelete;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1905,7 +1905,7 @@
</span><span class="cx"> couldDelete = baseObj->methodTable(vm)->deleteProperty(baseObj, exec, property);
</span><span class="cx"> }
</span><span class="cx"> if (!couldDelete && exec->codeBlock()->isStrictMode())
</span><del>- vm.throwException(exec, createTypeError(exec, ASCIILiteral("Unable to delete property.")));
</del><ins>+ throwTypeError(exec, ASCIILiteral("Unable to delete property."));
</ins><span class="cx"> return couldDelete;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeDatePrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -1112,13 +1112,13 @@
</span><span class="cx"> CallData callData;
</span><span class="cx"> CallType callType = getCallData(toISOValue, callData);
</span><span class="cx"> if (callType == CallType::None)
</span><del>- return throwVMError(exec, createTypeError(exec, ASCIILiteral("toISOString is not a function")));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("toISOString is not a function"));
</ins><span class="cx">
</span><span class="cx"> JSValue result = call(exec, asObject(toISOValue), callType, callData, object, exec->emptyList());
</span><span class="cx"> if (exec->hadException())
</span><span class="cx"> return JSValue::encode(jsNull());
</span><span class="cx"> if (result.isObject())
</span><del>- return throwVMError(exec, createTypeError(exec, ASCIILiteral("toISOString did not return a primitive value")));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("toISOString did not return a primitive value"));
</ins><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeErrorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Error.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Error.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/JavaScriptCore/runtime/Error.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -208,7 +208,7 @@
</span><span class="cx">
</span><span class="cx"> JSObject* throwConstructorCannotBeCalledAsFunctionTypeError(ExecState* exec, const char* constructorName)
</span><span class="cx"> {
</span><del>- return exec->vm().throwException(exec, createTypeError(exec, makeString("calling ", constructorName, " constructor without new is invalid")));
</del><ins>+ return throwTypeError(exec, makeString("calling ", constructorName, " constructor without new is invalid"));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> JSObject* throwTypeError(ExecState* exec)
</span><span class="lines">@@ -216,6 +216,11 @@
</span><span class="cx"> return exec->vm().throwException(exec, createTypeError(exec));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+JSObject* throwTypeError(ExecState* exec, ASCIILiteral errorMessage)
+{
+ return throwTypeError(exec, String(errorMessage));
+}
+
</ins><span class="cx"> JSObject* throwTypeError(ExecState* exec, const String& message)
</span><span class="cx"> {
</span><span class="cx"> return exec->vm().throwException(exec, createTypeError(exec, message));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeErrorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Error.h (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Error.h        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/JavaScriptCore/runtime/Error.h        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -74,6 +74,7 @@
</span><span class="cx"> // Convenience wrappers, create an throw an exception with a default message.
</span><span class="cx"> JS_EXPORT_PRIVATE JSObject* throwConstructorCannotBeCalledAsFunctionTypeError(ExecState*, const char* constructorName);
</span><span class="cx"> JS_EXPORT_PRIVATE JSObject* throwTypeError(ExecState*);
</span><ins>+JS_EXPORT_PRIVATE JSObject* throwTypeError(ExecState*, ASCIILiteral errorMessage);
</ins><span class="cx"> JS_EXPORT_PRIVATE JSObject* throwTypeError(ExecState*, const String& errorMessage);
</span><span class="cx"> JS_EXPORT_PRIVATE JSObject* throwSyntaxError(ExecState*);
</span><span class="cx"> JS_EXPORT_PRIVATE JSObject* throwSyntaxError(ExecState*, const String& errorMessage);
</span><span class="lines">@@ -83,6 +84,7 @@
</span><span class="cx"> inline void throwVMError(ExecState* exec, Exception* exception) { exec->vm().throwException(exec, exception); }
</span><span class="cx"> inline EncodedJSValue throwVMError(ExecState* exec, JSValue error) { return JSValue::encode(exec->vm().throwException(exec, error)); }
</span><span class="cx"> inline EncodedJSValue throwVMTypeError(ExecState* exec) { return JSValue::encode(throwTypeError(exec)); }
</span><ins>+inline EncodedJSValue throwVMTypeError(ExecState* exec, ASCIILiteral errorMessage) { return JSValue::encode(throwTypeError(exec, errorMessage)); }
</ins><span class="cx"> inline EncodedJSValue throwVMTypeError(ExecState* exec, const String& errorMessage) { return JSValue::encode(throwTypeError(exec, errorMessage)); }
</span><span class="cx"> inline EncodedJSValue throwVMRangeError(ExecState* state, const String& errorMessage) { return JSValue::encode(throwRangeError(state, errorMessage)); }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSArrayBufferPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSArrayBufferPrototype.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSArrayBufferPrototype.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/JavaScriptCore/runtime/JSArrayBufferPrototype.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -41,10 +41,10 @@
</span><span class="cx">
</span><span class="cx"> JSArrayBuffer* thisObject = jsDynamicCast<JSArrayBuffer*>(exec->thisValue());
</span><span class="cx"> if (!thisObject)
</span><del>- return throwVMError(exec, createTypeError(exec, ASCIILiteral("Receiver of slice must be an array buffer.")));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Receiver of slice must be an array buffer."));
</ins><span class="cx">
</span><span class="cx"> if (!exec->argumentCount())
</span><del>- return throwVMError(exec, createTypeError(exec, ASCIILiteral("Slice requires at least one argument.")));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Slice requires at least one argument."));
</ins><span class="cx">
</span><span class="cx"> int32_t begin = exec->argument(0).toInt32(exec);
</span><span class="cx"> if (exec->hadException())
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSCJSValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSCJSValue.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSCJSValue.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/JavaScriptCore/runtime/JSCJSValue.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -157,7 +157,7 @@
</span><span class="cx"> if (offset != invalidOffset) {
</span><span class="cx"> if (attributes & ReadOnly) {
</span><span class="cx"> if (slot.isStrictMode())
</span><del>- exec->vm().throwException(exec, createTypeError(exec, StrictModeReadonlyPropertyWriteError));
</del><ins>+ throwTypeError(exec, StrictModeReadonlyPropertyWriteError);
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -346,7 +346,7 @@
</span><span class="cx"> if (isUndefined())
</span><span class="cx"> return vm.smallStrings.undefinedString();
</span><span class="cx"> if (isSymbol()) {
</span><del>- throwTypeError(exec, "Cannot convert a symbol to a string");
</del><ins>+ throwTypeError(exec, ASCIILiteral("Cannot convert a symbol to a string"));
</ins><span class="cx"> return errorValue();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSCJSValueInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSCJSValueInlines.h (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSCJSValueInlines.h        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/JavaScriptCore/runtime/JSCJSValueInlines.h        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -632,7 +632,7 @@
</span><span class="cx"> inline PreferredPrimitiveType toPreferredPrimitiveType(ExecState* exec, JSValue value)
</span><span class="cx"> {
</span><span class="cx"> if (!value.isString()) {
</span><del>- throwTypeError(exec, "Primitive hint is not a string.");
</del><ins>+ throwTypeError(exec, ASCIILiteral("Primitive hint is not a string."));
</ins><span class="cx"> return NoPreference;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -647,7 +647,7 @@
</span><span class="cx"> if (WTF::equal(hintString, "string"))
</span><span class="cx"> return PreferString;
</span><span class="cx">
</span><del>- throwTypeError(exec, "Expected primitive hint to match one of 'default', 'number', 'string'.");
</del><ins>+ throwTypeError(exec, ASCIILiteral("Expected primitive hint to match one of 'default', 'number', 'string'."));
</ins><span class="cx"> return NoPreference;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSDataViewPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSDataViewPrototype.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSDataViewPrototype.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/JavaScriptCore/runtime/JSDataViewPrototype.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -124,10 +124,10 @@
</span><span class="cx"> {
</span><span class="cx"> JSDataView* dataView = jsDynamicCast<JSDataView*>(exec->thisValue());
</span><span class="cx"> if (!dataView)
</span><del>- return throwVMError(exec, createTypeError(exec, ASCIILiteral("Receiver of DataView method must be a DataView")));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Receiver of DataView method must be a DataView"));
</ins><span class="cx">
</span><span class="cx"> if (!exec->argumentCount())
</span><del>- return throwVMError(exec, createTypeError(exec, ASCIILiteral("Need at least one argument (the byteOffset)")));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Need at least one argument (the byteOffset)"));
</ins><span class="cx">
</span><span class="cx"> unsigned byteOffset = exec->uncheckedArgument(0).toUInt32(exec);
</span><span class="cx"> if (exec->hadException())
</span><span class="lines">@@ -169,10 +169,10 @@
</span><span class="cx"> {
</span><span class="cx"> JSDataView* dataView = jsDynamicCast<JSDataView*>(exec->thisValue());
</span><span class="cx"> if (!dataView)
</span><del>- return throwVMError(exec, createTypeError(exec, ASCIILiteral("Receiver of DataView method must be a DataView")));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Receiver of DataView method must be a DataView"));
</ins><span class="cx">
</span><span class="cx"> if (exec->argumentCount() < 2)
</span><del>- return throwVMError(exec, createTypeError(exec, ASCIILiteral("Need at least two argument (the byteOffset and value)")));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Need at least two argument (the byteOffset and value)"));
</ins><span class="cx">
</span><span class="cx"> unsigned byteOffset = exec->uncheckedArgument(0).toUInt32(exec);
</span><span class="cx"> if (exec->hadException())
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSFunctioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSFunction.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSFunction.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/JavaScriptCore/runtime/JSFunction.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -506,27 +506,27 @@
</span><span class="cx">
</span><span class="cx"> if (descriptor.configurablePresent() && descriptor.configurable()) {
</span><span class="cx"> if (throwException)
</span><del>- exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral("Attempting to change configurable attribute of unconfigurable property.")));
</del><ins>+ throwTypeError(exec, ASCIILiteral("Attempting to change configurable attribute of unconfigurable property."));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> if (descriptor.enumerablePresent() && descriptor.enumerable()) {
</span><span class="cx"> if (throwException)
</span><del>- exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral("Attempting to change enumerable attribute of unconfigurable property.")));
</del><ins>+ throwTypeError(exec, ASCIILiteral("Attempting to change enumerable attribute of unconfigurable property."));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> if (descriptor.isAccessorDescriptor()) {
</span><span class="cx"> if (throwException)
</span><del>- exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral(UnconfigurablePropertyChangeAccessMechanismError)));
</del><ins>+ throwTypeError(exec, ASCIILiteral(UnconfigurablePropertyChangeAccessMechanismError));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> if (descriptor.writablePresent() && descriptor.writable()) {
</span><span class="cx"> if (throwException)
</span><del>- exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral("Attempting to change writable attribute of unconfigurable property.")));
</del><ins>+ throwTypeError(exec, ASCIILiteral("Attempting to change writable attribute of unconfigurable property."));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> if (!valueCheck) {
</span><span class="cx"> if (throwException)
</span><del>- exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral("Attempting to change value of a readonly property.")));
</del><ins>+ throwTypeError(exec, ASCIILiteral("Attempting to change value of a readonly property."));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> return true;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGenericTypedArrayViewConstructorInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx"> inline JSObject* constructGenericTypedArrayViewFromIterator(ExecState* exec, Structure* structure, JSValue iterator)
</span><span class="cx"> {
</span><span class="cx"> if (!iterator.isObject())
</span><del>- return throwTypeError(exec, "Symbol.Iterator for the first argument did not return an object.");
</del><ins>+ return throwTypeError(exec, ASCIILiteral("Symbol.Iterator for the first argument did not return an object."));
</ins><span class="cx">
</span><span class="cx"> MarkedArgumentBuffer storage;
</span><span class="cx"> while (true) {
</span><span class="lines">@@ -139,7 +139,7 @@
</span><span class="cx"> ASSERT(!offset && !lengthOpt);
</span><span class="cx">
</span><span class="cx"> if (ViewClass::TypedArrayStorageType == TypeDataView)
</span><del>- return throwTypeError(exec, "Expected ArrayBuffer for the first argument.");
</del><ins>+ return throwTypeError(exec, ASCIILiteral("Expected ArrayBuffer for the first argument."));
</ins><span class="cx">
</span><span class="cx"> // For everything but DataView, we allow construction with any of:
</span><span class="cx"> // - Another array. This creates a copy of the of that array.
</span><span class="lines">@@ -174,7 +174,7 @@
</span><span class="cx"> CallData callData;
</span><span class="cx"> CallType callType = getCallData(iteratorFunc, callData);
</span><span class="cx"> if (callType == CallType::None)
</span><del>- return throwTypeError(exec, "Symbol.Iterator for the first argument cannot be called.");
</del><ins>+ return throwTypeError(exec, ASCIILiteral("Symbol.Iterator for the first argument cannot be called."));
</ins><span class="cx">
</span><span class="cx"> ArgList arguments;
</span><span class="cx"> JSValue iterator = call(exec, iteratorFunc, callType, callData, object, arguments);
</span><span class="lines">@@ -206,11 +206,11 @@
</span><span class="cx"> if (firstValue.isInt32())
</span><span class="cx"> length = firstValue.asInt32();
</span><span class="cx"> else if (!firstValue.isNumber())
</span><del>- return throwTypeError(exec, "Invalid array length argument");
</del><ins>+ return throwTypeError(exec, ASCIILiteral("Invalid array length argument"));
</ins><span class="cx"> else {
</span><span class="cx"> length = static_cast<int>(firstValue.asNumber());
</span><span class="cx"> if (length != firstValue.asNumber())
</span><del>- return throwTypeError(exec, "Invalid array length argument (fractional lengths not allowed)");
</del><ins>+ return throwTypeError(exec, ASCIILiteral("Invalid array length argument (fractional lengths not allowed)"));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (length < 0)
</span><span class="lines">@@ -234,7 +234,7 @@
</span><span class="cx">
</span><span class="cx"> if (!argCount) {
</span><span class="cx"> if (ViewClass::TypedArrayStorageType == TypeDataView)
</span><del>- return throwVMError(exec, createTypeError(exec, "DataView constructor requires at least one argument."));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("DataView constructor requires at least one argument."));
</ins><span class="cx">
</span><span class="cx"> return JSValue::encode(ViewClass::create(exec, structure, 0));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGenericTypedArrayViewPrototypeFunctionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx"> if (constructor.isUndefined())
</span><span class="cx"> return defaultConstructor();
</span><span class="cx"> if (!constructor.isObject()) {
</span><del>- throwTypeError(exec, "constructor Property should not be null");
</del><ins>+ throwTypeError(exec, ASCIILiteral("constructor Property should not be null"));
</ins><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx"> if (JSArrayBufferView* view = jsDynamicCast<JSArrayBufferView*>(result))
</span><span class="cx"> return view;
</span><span class="cx">
</span><del>- throwTypeError(exec, "species constructor did not return a TypedArray View");
</del><ins>+ throwTypeError(exec, ASCIILiteral("species constructor did not return a TypedArray View"));
</ins><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -99,7 +99,7 @@
</span><span class="cx"> ViewClass* thisObject = jsCast<ViewClass*>(exec->thisValue());
</span><span class="cx">
</span><span class="cx"> if (!exec->argumentCount())
</span><del>- return throwVMError(exec, createTypeError(exec, "Expected at least one argument"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Expected at least one argument"));
</ins><span class="cx">
</span><span class="cx"> unsigned offset;
</span><span class="cx"> if (exec->argumentCount() >= 2) {
</span><span class="lines">@@ -117,7 +117,7 @@
</span><span class="cx">
</span><span class="cx"> JSObject* sourceArray = jsDynamicCast<JSObject*>(exec->uncheckedArgument(0));
</span><span class="cx"> if (!sourceArray)
</span><del>- return throwVMError(exec, createTypeError(exec, "First argument should be an object"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("First argument should be an object"));
</ins><span class="cx">
</span><span class="cx"> unsigned length;
</span><span class="cx"> if (isTypedView(sourceArray->classInfo()->typedArrayStorageType)) {
</span><span class="lines">@@ -145,7 +145,7 @@
</span><span class="cx"> return throwVMTypeError(exec, typedArrayBufferHasBeenDetachedErrorMessage);
</span><span class="cx">
</span><span class="cx"> if (exec->argumentCount() < 2)
</span><del>- return throwVMError(exec, createTypeError(exec, "Expected at least two arguments"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Expected at least two arguments"));
</ins><span class="cx">
</span><span class="cx"> if (exec->hadException())
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -200,7 +200,7 @@
</span><span class="cx"> return throwVMTypeError(exec, typedArrayBufferHasBeenDetachedErrorMessage);
</span><span class="cx">
</span><span class="cx"> if (!exec->argumentCount())
</span><del>- return throwVMError(exec, createTypeError(exec, "Expected at least one argument"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Expected at least one argument"));
</ins><span class="cx">
</span><span class="cx"> unsigned length = thisObject->length();
</span><span class="cx">
</span><span class="lines">@@ -264,7 +264,7 @@
</span><span class="cx"> return throwVMTypeError(exec, typedArrayBufferHasBeenDetachedErrorMessage);
</span><span class="cx">
</span><span class="cx"> if (!exec->argumentCount())
</span><del>- return throwVMError(exec, createTypeError(exec, "Expected at least one argument"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Expected at least one argument"));
</ins><span class="cx">
</span><span class="cx"> unsigned length = thisObject->length();
</span><span class="cx">
</span><span class="lines">@@ -442,7 +442,7 @@
</span><span class="cx"> return throwVMTypeError(exec, typedArrayBufferHasBeenDetachedErrorMessage);
</span><span class="cx">
</span><span class="cx"> if (!exec->argumentCount())
</span><del>- return throwVMError(exec, createTypeError(exec, "Expected at least one argument"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Expected at least one argument"));
</ins><span class="cx">
</span><span class="cx"> // Get the length here; later assert that the length didn't change.
</span><span class="cx"> unsigned thisLength = thisObject->length();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjectFunctionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -888,7 +888,7 @@
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL globalFuncProtoGetter(ExecState* exec)
</span><span class="cx"> {
</span><span class="cx"> if (exec->thisValue().isUndefinedOrNull())
</span><del>- return throwVMError(exec, createTypeError(exec, "Can't convert undefined or null to object"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Can't convert undefined or null to object"));
</ins><span class="cx">
</span><span class="cx"> JSObject* thisObject = jsDynamicCast<JSObject*>(exec->thisValue().toThis(exec, NotStrictMode));
</span><span class="cx">
</span><span class="lines">@@ -945,7 +945,7 @@
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL globalFuncProtoSetter(ExecState* exec)
</span><span class="cx"> {
</span><span class="cx"> if (exec->thisValue().isUndefinedOrNull())
</span><del>- return throwVMError(exec, createTypeError(exec, "Can't convert undefined or null to object"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Can't convert undefined or null to object"));
</ins><span class="cx">
</span><span class="cx"> JSValue value = exec->argument(0);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSONObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSONObject.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSONObject.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/JavaScriptCore/runtime/JSONObject.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -368,7 +368,7 @@
</span><span class="cx"> // Handle cycle detection, and put the holder on the stack.
</span><span class="cx"> for (unsigned i = 0; i < m_holderStack.size(); i++) {
</span><span class="cx"> if (m_holderStack[i].object() == object) {
</span><del>- m_exec->vm().throwException(m_exec, createTypeError(m_exec, ASCIILiteral("JSON.stringify cannot serialize cyclic structures.")));
</del><ins>+ throwTypeError(m_exec, ASCIILiteral("JSON.stringify cannot serialize cyclic structures."));
</ins><span class="cx"> return StringifyFailed;
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSObject.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSObject.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/JavaScriptCore/runtime/JSObject.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -1357,7 +1357,7 @@
</span><span class="cx">
</span><span class="cx"> if (!isExtensible) {
</span><span class="cx"> if (shouldThrowIfCantSet)
</span><del>- throwVMError(exec, createTypeError(exec, StrictModeReadonlyPropertyWriteError));
</del><ins>+ throwTypeError(exec, StrictModeReadonlyPropertyWriteError);
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1640,7 +1640,7 @@
</span><span class="cx"> if (exec->hadException())
</span><span class="cx"> return exec->exception();
</span><span class="cx"> if (result.isObject())
</span><del>- return mode == TypeHintMode::DoesNotTakeHint ? JSValue() : throwTypeError(exec, "Symbol.toPrimitive returned an object");
</del><ins>+ return mode == TypeHintMode::DoesNotTakeHint ? JSValue() : throwTypeError(exec, ASCIILiteral("Symbol.toPrimitive returned an object"));
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1670,7 +1670,7 @@
</span><span class="cx">
</span><span class="cx"> ASSERT(!exec->hadException());
</span><span class="cx">
</span><del>- return exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral("No default value")));
</del><ins>+ return throwTypeError(exec, ASCIILiteral("No default value"));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> JSValue JSObject::defaultValue(const JSObject* object, ExecState* exec, PreferredPrimitiveType hint)
</span><span class="lines">@@ -1756,7 +1756,7 @@
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> if (!proto.isObject()) {
</span><del>- exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral("instanceof called on an object with an invalid prototype property.")));
</del><ins>+ throwTypeError(exec, ASCIILiteral("instanceof called on an object with an invalid prototype property."));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2943,7 +2943,7 @@
</span><span class="cx"> // Step 2.a
</span><span class="cx"> if (!isExtensible) {
</span><span class="cx"> if (throwException)
</span><del>- exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral("Attempting to define property on object that is not extensible.")));
</del><ins>+ throwTypeError(exec, ASCIILiteral("Attempting to define property on object that is not extensible."));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> if (!object)
</span><span class="lines">@@ -2966,12 +2966,12 @@
</span><span class="cx"> if (!current.configurable()) {
</span><span class="cx"> if (descriptor.configurable()) {
</span><span class="cx"> if (throwException)
</span><del>- exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral("Attempting to change configurable attribute of unconfigurable property.")));
</del><ins>+ throwTypeError(exec, ASCIILiteral("Attempting to change configurable attribute of unconfigurable property."));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> if (descriptor.enumerablePresent() && descriptor.enumerable() != current.enumerable()) {
</span><span class="cx"> if (throwException)
</span><del>- exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral("Attempting to change enumerable attribute of unconfigurable property.")));
</del><ins>+ throwTypeError(exec, ASCIILiteral("Attempting to change enumerable attribute of unconfigurable property."));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -2991,7 +2991,7 @@
</span><span class="cx"> if (descriptor.isDataDescriptor() != current.isDataDescriptor()) {
</span><span class="cx"> if (!current.configurable()) {
</span><span class="cx"> if (throwException)
</span><del>- exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral(UnconfigurablePropertyChangeAccessMechanismError)));
</del><ins>+ throwTypeError(exec, ASCIILiteral(UnconfigurablePropertyChangeAccessMechanismError));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -3008,13 +3008,13 @@
</span><span class="cx"> if (!current.configurable()) {
</span><span class="cx"> if (!current.writable() && descriptor.writable()) {
</span><span class="cx"> if (throwException)
</span><del>- exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral("Attempting to change writable attribute of unconfigurable property.")));
</del><ins>+ throwTypeError(exec, ASCIILiteral("Attempting to change writable attribute of unconfigurable property."));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> if (!current.writable()) {
</span><span class="cx"> if (descriptor.value() && !sameValue(exec, current.value(), descriptor.value())) {
</span><span class="cx"> if (throwException)
</span><del>- exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral("Attempting to change value of a readonly property.")));
</del><ins>+ throwTypeError(exec, ASCIILiteral("Attempting to change value of a readonly property."));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -3033,17 +3033,17 @@
</span><span class="cx"> if (!current.configurable()) {
</span><span class="cx"> if (descriptor.setterPresent() && !(current.setterPresent() && JSValue::strictEqual(exec, current.setter(), descriptor.setter()))) {
</span><span class="cx"> if (throwException)
</span><del>- exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral("Attempting to change the setter of an unconfigurable property.")));
</del><ins>+ throwTypeError(exec, ASCIILiteral("Attempting to change the setter of an unconfigurable property."));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> if (descriptor.getterPresent() && !(current.getterPresent() && JSValue::strictEqual(exec, current.getter(), descriptor.getter()))) {
</span><span class="cx"> if (throwException)
</span><del>- exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral("Attempting to change the getter of an unconfigurable property.")));
</del><ins>+ throwTypeError(exec, ASCIILiteral("Attempting to change the getter of an unconfigurable property."));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> if (current.attributes() & CustomAccessor) {
</span><span class="cx"> if (throwException)
</span><del>- exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral(UnconfigurablePropertyChangeAccessMechanismError)));
</del><ins>+ throwTypeError(exec, ASCIILiteral(UnconfigurablePropertyChangeAccessMechanismError));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSTypedArrayViewConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewConstructor.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewConstructor.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewConstructor.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -71,15 +71,15 @@
</span><span class="cx">
</span><span class="cx"> JSObject* object = jsDynamicCast<JSObject*>(value);
</span><span class="cx"> if (!object)
</span><del>- return JSValue::encode(throwTypeError(exec, "new.target passed to TypedArray is not an object."));
</del><ins>+ return JSValue::encode(throwTypeError(exec, ASCIILiteral("new.target passed to TypedArray is not an object.")));
</ins><span class="cx">
</span><span class="cx"> ConstructData data;
</span><span class="cx"> if (object->methodTable()->getConstructData(object, data) == ConstructType::None)
</span><del>- return JSValue::encode(throwTypeError(exec, "new.target passed to TypedArray is not a valid constructor."));
</del><ins>+ return JSValue::encode(throwTypeError(exec, ASCIILiteral("new.target passed to TypedArray is not a valid constructor.")));
</ins><span class="cx">
</span><span class="cx"> for (; !value.isNull(); value = jsCast<JSObject*>(value)->getPrototypeDirect()) {
</span><span class="cx"> if (jsDynamicCast<JSTypedArrayViewConstructor*>(value))
</span><del>- return JSValue::encode(throwTypeError(exec, "Unable to find TypedArray constructor that inherits from TypedArray."));
</del><ins>+ return JSValue::encode(throwTypeError(exec, ASCIILiteral("Unable to find TypedArray constructor that inherits from TypedArray.")));
</ins><span class="cx"> if (jsDynamicCast<JSGenericTypedArrayViewConstructor<JSInt8Array>*>(value))
</span><span class="cx"> return constructGenericTypedArrayView<JSInt8Array>(exec);
</span><span class="cx"> if (jsDynamicCast<JSGenericTypedArrayViewConstructor<JSInt16Array>*>(value))
</span><span class="lines">@@ -100,7 +100,7 @@
</span><span class="cx"> return constructGenericTypedArrayView<JSFloat64Array>(exec);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- return JSValue::encode(throwTypeError(exec, "Unable to find TypedArray constructor in prototype-chain, hit null."));
</del><ins>+ return JSValue::encode(throwTypeError(exec, ASCIILiteral("Unable to find TypedArray constructor in prototype-chain, hit null.")));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> ConstructType JSTypedArrayViewConstructor::getConstructData(JSCell*, ConstructData& constructData)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSTypedArrayViewPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -58,8 +58,8 @@
</span><span class="cx"> return functionName<JSUint16Array>(exec); \
</span><span class="cx"> case NotTypedArray: \
</span><span class="cx"> case TypeDataView: \
</span><del>- return throwVMError(exec, createTypeError(exec, \
- "Receiver should be a typed array view")); \
</del><ins>+ return throwVMTypeError(exec, \
+ ASCIILiteral("Receiver should be a typed array view")); \
</ins><span class="cx"> } \
</span><span class="cx"> RELEASE_ASSERT_NOT_REACHED(); \
</span><span class="cx"> } while (false)
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx">
</span><span class="cx"> JSArrayBufferView* thisObject = jsCast<JSArrayBufferView*>(argument);
</span><span class="cx"> if (!thisObject || thisObject->mode() == DataViewMode)
</span><del>- return throwVMError(exec, createTypeError(exec, "Receiver should be a typed array view"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Receiver should be a typed array view"));
</ins><span class="cx"> if (thisObject->isNeutered())
</span><span class="cx"> return throwVMTypeError(exec, "Underlying ArrayBuffer has been detached from the view");
</span><span class="cx">
</span><span class="lines">@@ -103,7 +103,7 @@
</span><span class="cx"> {
</span><span class="cx"> JSValue thisValue = exec->thisValue();
</span><span class="cx"> if (!thisValue.isObject())
</span><del>- return throwVMError(exec, createTypeError(exec, "Receiver should be a typed array view but was not an object"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Receiver should be a typed array view but was not an object"));
</ins><span class="cx"> CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoFuncSet);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -111,7 +111,7 @@
</span><span class="cx"> {
</span><span class="cx"> JSValue thisValue = exec->thisValue();
</span><span class="cx"> if (!thisValue.isObject())
</span><del>- return throwVMError(exec, createTypeError(exec, "Receiver should be a typed array view but was not an object"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Receiver should be a typed array view but was not an object"));
</ins><span class="cx"> CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoFuncCopyWithin);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -119,7 +119,7 @@
</span><span class="cx"> {
</span><span class="cx"> JSValue thisValue = exec->thisValue();
</span><span class="cx"> if (!thisValue.isObject())
</span><del>- return throwVMError(exec, createTypeError(exec, "Receiver should be a typed array view but was not an object"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Receiver should be a typed array view but was not an object"));
</ins><span class="cx"> CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoFuncFill);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -127,7 +127,7 @@
</span><span class="cx"> {
</span><span class="cx"> JSValue thisValue = exec->thisValue();
</span><span class="cx"> if (!thisValue.isObject())
</span><del>- return throwVMError(exec, createTypeError(exec, "Receiver should be a typed array view but was not an object"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Receiver should be a typed array view but was not an object"));
</ins><span class="cx"> CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoFuncLastIndexOf);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -135,7 +135,7 @@
</span><span class="cx"> {
</span><span class="cx"> JSValue thisValue = exec->thisValue();
</span><span class="cx"> if (!thisValue.isObject())
</span><del>- return throwVMError(exec, createTypeError(exec, "Receiver should be a typed array view but was not an object"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Receiver should be a typed array view but was not an object"));
</ins><span class="cx"> CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoFuncIndexOf);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -143,7 +143,7 @@
</span><span class="cx"> {
</span><span class="cx"> JSValue thisValue = exec->thisValue();
</span><span class="cx"> if (!thisValue.isObject())
</span><del>- return throwVMError(exec, createTypeError(exec, "Receiver should be a typed array view but was not an object"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Receiver should be a typed array view but was not an object"));
</ins><span class="cx"> CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoFuncJoin);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -151,7 +151,7 @@
</span><span class="cx"> {
</span><span class="cx"> JSValue thisValue = exec->thisValue();
</span><span class="cx"> if (!thisValue.isObject())
</span><del>- return throwVMError(exec, createTypeError(exec, "Receiver should be a typed array view but was not an object"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Receiver should be a typed array view but was not an object"));
</ins><span class="cx"> CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoGetterFuncBuffer);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -159,7 +159,7 @@
</span><span class="cx"> {
</span><span class="cx"> JSValue thisValue = exec->thisValue();
</span><span class="cx"> if (!thisValue.isObject())
</span><del>- return throwVMError(exec, createTypeError(exec, "Receiver should be a typed array view but was not an object"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Receiver should be a typed array view but was not an object"));
</ins><span class="cx"> CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoGetterFuncLength);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -167,7 +167,7 @@
</span><span class="cx"> {
</span><span class="cx"> JSValue thisValue = exec->thisValue();
</span><span class="cx"> if (!thisValue.isObject())
</span><del>- return throwVMError(exec, createTypeError(exec, "Receiver should be a typed array view but was not an object"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Receiver should be a typed array view but was not an object"));
</ins><span class="cx"> CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoGetterFuncByteLength);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -175,7 +175,7 @@
</span><span class="cx"> {
</span><span class="cx"> JSValue thisValue = exec->thisValue();
</span><span class="cx"> if (!thisValue.isObject())
</span><del>- return throwVMError(exec, createTypeError(exec, "Receiver should be a typed array view but was not an object"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Receiver should be a typed array view but was not an object"));
</ins><span class="cx"> CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoGetterFuncByteOffset);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -183,7 +183,7 @@
</span><span class="cx"> {
</span><span class="cx"> JSValue thisValue = exec->thisValue();
</span><span class="cx"> if (!thisValue.isObject())
</span><del>- return throwVMError(exec, createTypeError(exec, "Receiver should be a typed array view but was not an object"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Receiver should be a typed array view but was not an object"));
</ins><span class="cx"> CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoFuncReverse);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -191,7 +191,7 @@
</span><span class="cx"> {
</span><span class="cx"> JSValue thisValue = exec->thisValue();
</span><span class="cx"> if (!thisValue.isObject())
</span><del>- return throwVMError(exec, createTypeError(exec, "Receiver should be a typed array view but was not an object"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Receiver should be a typed array view but was not an object"));
</ins><span class="cx"> CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoFuncSubarray);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -199,7 +199,7 @@
</span><span class="cx"> {
</span><span class="cx"> JSValue thisValue = exec->thisValue();
</span><span class="cx"> if (!thisValue.isObject())
</span><del>- return throwVMError(exec, createTypeError(exec, "Receiver should be a typed array view but was not an object"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Receiver should be a typed array view but was not an object"));
</ins><span class="cx"> CALL_GENERIC_TYPEDARRAY_PROTOTYPE_FUNCTION(genericTypedArrayViewProtoFuncSlice);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeObjectConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -335,7 +335,7 @@
</span><span class="cx"> {
</span><span class="cx"> VM& vm = exec->vm();
</span><span class="cx"> if (!in.isObject()) {
</span><del>- vm.throwException(exec, createTypeError(exec, ASCIILiteral("Property description must be an object.")));
</del><ins>+ throwTypeError(exec, ASCIILiteral("Property description must be an object."));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> JSObject* description = asObject(in);
</span><span class="lines">@@ -380,7 +380,7 @@
</span><span class="cx"> if (!get.isUndefined()) {
</span><span class="cx"> CallData callData;
</span><span class="cx"> if (getCallData(get, callData) == CallType::None) {
</span><del>- vm.throwException(exec, createTypeError(exec, ASCIILiteral("Getter must be a function.")));
</del><ins>+ throwTypeError(exec, ASCIILiteral("Getter must be a function."));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -395,7 +395,7 @@
</span><span class="cx"> if (!set.isUndefined()) {
</span><span class="cx"> CallData callData;
</span><span class="cx"> if (getCallData(set, callData) == CallType::None) {
</span><del>- vm.throwException(exec, createTypeError(exec, ASCIILiteral("Setter must be a function.")));
</del><ins>+ throwTypeError(exec, ASCIILiteral("Setter must be a function."));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -407,12 +407,12 @@
</span><span class="cx"> return true;
</span><span class="cx">
</span><span class="cx"> if (desc.value()) {
</span><del>- vm.throwException(exec, createTypeError(exec, ASCIILiteral("Invalid property. 'value' present on property with getter or setter.")));
</del><ins>+ throwTypeError(exec, ASCIILiteral("Invalid property. 'value' present on property with getter or setter."));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (desc.writablePresent()) {
</span><del>- vm.throwException(exec, createTypeError(exec, ASCIILiteral("Invalid property. 'writable' present on property with getter or setter.")));
</del><ins>+ throwTypeError(exec, ASCIILiteral("Invalid property. 'writable' present on property with getter or setter."));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> return true;
</span><span class="lines">@@ -421,7 +421,7 @@
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL objectConstructorDefineProperty(ExecState* exec)
</span><span class="cx"> {
</span><span class="cx"> if (!exec->argument(0).isObject())
</span><del>- return throwVMError(exec, createTypeError(exec, ASCIILiteral("Properties can only be defined on Objects.")));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Properties can only be defined on Objects."));
</ins><span class="cx"> JSObject* O = asObject(exec->argument(0));
</span><span class="cx"> auto propertyName = exec->argument(1).toPropertyKey(exec);
</span><span class="cx"> if (exec->hadException())
</span><span class="lines">@@ -476,7 +476,7 @@
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL objectConstructorDefineProperties(ExecState* exec)
</span><span class="cx"> {
</span><span class="cx"> if (!exec->argument(0).isObject())
</span><del>- return throwVMError(exec, createTypeError(exec, ASCIILiteral("Properties can only be defined on Objects.")));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Properties can only be defined on Objects."));
</ins><span class="cx"> JSObject* targetObj = asObject(exec->argument(0));
</span><span class="cx"> JSObject* props = exec->argument(1).toObject(exec);
</span><span class="cx"> if (!props)
</span><span class="lines">@@ -488,7 +488,7 @@
</span><span class="cx"> {
</span><span class="cx"> JSValue proto = exec->argument(0);
</span><span class="cx"> if (!proto.isObject() && !proto.isNull())
</span><del>- return throwVMError(exec, createTypeError(exec, ASCIILiteral("Object prototype may only be an Object or null.")));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Object prototype may only be an Object or null."));
</ins><span class="cx"> JSObject* newObject = proto.isObject()
</span><span class="cx"> ? constructEmptyObject(exec, asObject(proto))
</span><span class="cx"> : constructEmptyObject(exec, exec->lexicalGlobalObject()->nullPrototypeObjectStructure());
</span><span class="lines">@@ -495,7 +495,7 @@
</span><span class="cx"> if (exec->argument(1).isUndefined())
</span><span class="cx"> return JSValue::encode(newObject);
</span><span class="cx"> if (!exec->argument(1).isObject())
</span><del>- return throwVMError(exec, createTypeError(exec, ASCIILiteral("Property descriptor list must be an Object.")));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Property descriptor list must be an Object."));
</ins><span class="cx"> return JSValue::encode(defineProperties(exec, newObject, asObject(exec->argument(1))));
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeObjectPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -134,7 +134,7 @@
</span><span class="cx"> JSValue get = exec->argument(1);
</span><span class="cx"> CallData callData;
</span><span class="cx"> if (getCallData(get, callData) == CallType::None)
</span><del>- return throwVMError(exec, createTypeError(exec, ASCIILiteral("invalid getter usage")));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("invalid getter usage"));
</ins><span class="cx">
</span><span class="cx"> auto propertyName = exec->argument(0).toPropertyKey(exec);
</span><span class="cx"> if (exec->hadException())
</span><span class="lines">@@ -160,7 +160,7 @@
</span><span class="cx"> JSValue set = exec->argument(1);
</span><span class="cx"> CallData callData;
</span><span class="cx"> if (getCallData(set, callData) == CallType::None)
</span><del>- return throwVMError(exec, createTypeError(exec, ASCIILiteral("invalid setter usage")));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("invalid setter usage"));
</ins><span class="cx">
</span><span class="cx"> auto propertyName = exec->argument(0).toPropertyKey(exec);
</span><span class="cx"> if (exec->hadException())
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeRegExpPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -143,7 +143,7 @@
</span><span class="cx">
</span><span class="cx"> if (arg0.inherits(RegExpObject::info())) {
</span><span class="cx"> if (!arg1.isUndefined())
</span><del>- return throwVMError(exec, createTypeError(exec, ASCIILiteral("Cannot supply flags when constructing one RegExp from another.")));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Cannot supply flags when constructing one RegExp from another."));
</ins><span class="cx"> regExp = asRegExpObject(arg0)->regExp();
</span><span class="cx"> } else {
</span><span class="cx"> String pattern = !exec->argumentCount() ? emptyString() : arg0.toString(exec)->value(exec);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeSymbolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Symbol.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Symbol.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/JavaScriptCore/runtime/Symbol.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx">
</span><span class="cx"> double Symbol::toNumber(ExecState* exec) const
</span><span class="cx"> {
</span><del>- throwTypeError(exec, "Cannot convert a symbol to a number");
</del><ins>+ throwTypeError(exec, ASCIILiteral("Cannot convert a symbol to a number"));
</ins><span class="cx"> return 0.0;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/WebCore/ChangeLog        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -1,3 +1,69 @@
</span><ins>+2016-07-06 Benjamin Poulain <bpoulain@apple.com>
+
+ [JSC] Unify how we throw TypeError from C++
+ https://bugs.webkit.org/show_bug.cgi?id=159500
+
+ Reviewed by Saam Barati.
+
+ * bindings/js/JSBiquadFilterNodeCustom.cpp:
+ (WebCore::JSBiquadFilterNode::setType):
+ * bindings/js/JSBlobCustom.cpp:
+ (WebCore::constructJSBlob):
+ * bindings/js/JSCryptoKeySerializationJWK.cpp:
+ (WebCore::getBigIntegerVectorFromJSON):
+ (WebCore::JSCryptoKeySerializationJWK::JSCryptoKeySerializationJWK):
+ (WebCore::tryJWKKeyOpsValue):
+ (WebCore::JSCryptoKeySerializationJWK::reconcileUsages):
+ (WebCore::JSCryptoKeySerializationJWK::keyDataOctetSequence):
+ (WebCore::JSCryptoKeySerializationJWK::keyDataRSAComponents):
+ (WebCore::JSCryptoKeySerializationJWK::keyData):
+ (WebCore::addJWKAlgorithmToJSON):
+ (WebCore::JSCryptoKeySerializationJWK::serialize):
+ * bindings/js/JSCryptoOperationData.cpp:
+ (WebCore::cryptoOperationDataFromJSValue):
+ * bindings/js/JSDOMBinding.cpp:
+ (WebCore::enforceRange):
+ (WebCore::throwTypeError):
+ (WebCore::throwArgumentMustBeEnumError):
+ (WebCore::throwArgumentMustBeFunctionError):
+ (WebCore::throwArgumentTypeError):
+ (WebCore::throwArrayElementTypeError):
+ (WebCore::throwGetterTypeError):
+ (WebCore::throwThisTypeError):
+ * bindings/js/JSDataCueCustom.cpp:
+ (WebCore::constructJSDataCue):
+ * bindings/js/JSDocumentCustom.cpp:
+ (WebCore::JSDocument::defineElement):
+ * bindings/js/JSFileCustom.cpp:
+ (WebCore::constructJSFile):
+ * bindings/js/JSModuleLoader.cpp:
+ (WebCore::JSModuleLoader::evaluate):
+ * bindings/js/JSMutationObserverCustom.cpp:
+ (WebCore::constructJSMutationObserver):
+ * bindings/js/JSOscillatorNodeCustom.cpp:
+ (WebCore::JSOscillatorNode::setType):
+ * bindings/js/JSPannerNodeCustom.cpp:
+ (WebCore::JSPannerNode::setPanningModel):
+ (WebCore::JSPannerNode::setDistanceModel):
+ * bindings/js/JSReadableStreamPrivateConstructors.cpp:
+ (WebCore::constructJSReadableStreamController):
+ (WebCore::constructJSReadableStreamReader):
+ * bindings/js/JSSubtleCryptoCustom.cpp:
+ (WebCore::cryptoKeyFormatFromJSValue):
+ (WebCore::importKey):
+ (WebCore::exportKey):
+ * bindings/js/ReadableStreamController.cpp:
+ (WebCore::ReadableStreamController::invoke):
+ * bindings/js/SerializedScriptValue.cpp:
+ (WebCore::CloneDeserializer::throwValidationError):
+ (WebCore::SerializedScriptValue::maybeThrowExceptionIfSerializationFailed):
+ * bridge/c/c_instance.cpp:
+ (JSC::Bindings::CInstance::invokeMethod):
+ * bridge/objc/objc_instance.mm:
+ (ObjcInstance::invokeMethod):
+ * bridge/objc/objc_runtime.mm:
+ (JSC::Bindings::ObjcArray::setValueAt):
+
</ins><span class="cx"> 2016-07-06 Tim Horton <timothy_horton@apple.com>
</span><span class="cx">
</span><span class="cx"> Email from June 1st containing text 'Today @ 7:10PM' is linkified, but shouldn't be
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSBiquadFilterNodeCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSBiquadFilterNodeCustom.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSBiquadFilterNodeCustom.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/WebCore/bindings/js/JSBiquadFilterNodeCustom.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx"> if (value.isNumber()) {
</span><span class="cx"> uint32_t type = value.toUInt32(&state);
</span><span class="cx"> if (!wrapped().setType(type))
</span><del>- state.vm().throwException(&state, createTypeError(&state, "Illegal BiquadFilterNode type"));
</del><ins>+ throwTypeError(&state, "Illegal BiquadFilterNode type");
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- state.vm().throwException(&state, createTypeError(&state, "Illegal BiquadFilterNode type"));
</del><ins>+ throwTypeError(&state, "Illegal BiquadFilterNode type");
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSBlobCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -84,7 +84,7 @@
</span><span class="cx"> JSValue blobPropertyBagValue = exec->argument(1);
</span><span class="cx">
</span><span class="cx"> if (!blobPropertyBagValue.isObject())
</span><del>- return throwVMError(exec, createTypeError(exec, "Second argument of the constructor is not of type Object"));
</del><ins>+ return throwVMTypeError(exec, "Second argument of the constructor is not of type Object");
</ins><span class="cx">
</span><span class="cx"> // Given the above test, this will always yield an object.
</span><span class="cx"> JSObject* blobPropertyBagObject = blobPropertyBagValue.toObject(exec);
</span><span class="lines">@@ -99,7 +99,7 @@
</span><span class="cx">
</span><span class="cx"> if (containsEndings) {
</span><span class="cx"> if (endings != "transparent" && endings != "native")
</span><del>- return throwVMError(exec, createTypeError(exec, "The endings property must be either \"transparent\" or \"native\""));
</del><ins>+ return throwVMTypeError(exec, "The endings property must be either \"transparent\" or \"native\"");
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Attempt to get the type property.
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCryptoKeySerializationJWKcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -117,12 +117,12 @@
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> if (!base64URLDecode(base64urlEncodedNumber, result)) {
</span><del>- throwTypeError(exec, "Cannot decode base64url key data in JWK");
</del><ins>+ throwTypeError(exec, ASCIILiteral("Cannot decode base64url key data in JWK"));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (result[0] == 0) {
</span><del>- throwTypeError(exec, "JWK BigInteger must utilize the minimum number of octets to represent the value");
</del><ins>+ throwTypeError(exec, ASCIILiteral("JWK BigInteger must utilize the minimum number of octets to represent the value"));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -137,7 +137,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> if (!jsonValue || !jsonValue.isObject()) {
</span><del>- throwTypeError(exec, "Invalid JWK serialization");
</del><ins>+ throwTypeError(exec, ASCIILiteral("Invalid JWK serialization"));
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -253,7 +253,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (operation == tryOperation) {
</span><span class="cx"> if (usages & tryUsage) {
</span><del>- throwTypeError(exec, "JWK key_ops contains a duplicate operation");
</del><ins>+ throwTypeError(exec, ASCIILiteral("JWK key_ops contains a duplicate operation"));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> usages |= tryUsage;
</span><span class="lines">@@ -272,7 +272,7 @@
</span><span class="cx"> String operation;
</span><span class="cx"> if (!jsValue.getString(m_exec, operation)) {
</span><span class="cx"> if (!m_exec->hadException())
</span><del>- throwTypeError(m_exec, "JWK key_ops attribute could not be processed");
</del><ins>+ throwTypeError(m_exec, ASCIILiteral("JWK key_ops attribute could not be processed"));
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> if (!tryJWKKeyOpsValue(m_exec, jwkUsages, operation, ASCIILiteral("sign"), CryptoKeyUsageSign))
</span><span class="lines">@@ -362,13 +362,13 @@
</span><span class="cx"> String keyBase64URL;
</span><span class="cx"> if (!getStringFromJSON(m_exec, m_json.get(), "k", keyBase64URL)) {
</span><span class="cx"> if (!m_exec->hadException())
</span><del>- throwTypeError(m_exec, "Secret key data is not present is JWK");
</del><ins>+ throwTypeError(m_exec, ASCIILiteral("Secret key data is not present is JWK"));
</ins><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Vector<uint8_t> octetSequence;
</span><span class="cx"> if (!base64URLDecode(keyBase64URL, octetSequence)) {
</span><del>- throwTypeError(m_exec, "Cannot decode base64url key data in JWK");
</del><ins>+ throwTypeError(m_exec, ASCIILiteral("Cannot decode base64url key data in JWK"));
</ins><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -388,7 +388,7 @@
</span><span class="cx">
</span><span class="cx"> if (!getBigIntegerVectorFromJSON(m_exec, m_json.get(), "n", modulus)) {
</span><span class="cx"> if (!m_exec->hadException())
</span><del>- throwTypeError(m_exec, "Required JWK \"n\" member is missing");
</del><ins>+ throwTypeError(m_exec, ASCIILiteral("Required JWK \"n\" member is missing"));
</ins><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -399,7 +399,7 @@
</span><span class="cx">
</span><span class="cx"> if (!getBigIntegerVectorFromJSON(m_exec, m_json.get(), "e", exponent)) {
</span><span class="cx"> if (!m_exec->hadException())
</span><del>- throwTypeError(m_exec, "Required JWK \"e\" member is missing");
</del><ins>+ throwTypeError(m_exec, ASCIILiteral("Required JWK \"e\" member is missing"));
</ins><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -455,22 +455,22 @@
</span><span class="cx"> if (m_exec->hadException())
</span><span class="cx"> return nullptr;
</span><span class="cx"> if (!element.isObject()) {
</span><del>- throwTypeError(m_exec, "JWK \"oth\" array member is not an object");
</del><ins>+ throwTypeError(m_exec, ASCIILiteral("JWK \"oth\" array member is not an object"));
</ins><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx"> if (!getBigIntegerVectorFromJSON(m_exec, asObject(element), "r", info.primeFactor)) {
</span><span class="cx"> if (!m_exec->hadException())
</span><del>- throwTypeError(m_exec, "Cannot get prime factor for a prime in \"oth\" dictionary");
</del><ins>+ throwTypeError(m_exec, ASCIILiteral("Cannot get prime factor for a prime in \"oth\" dictionary"));
</ins><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx"> if (!getBigIntegerVectorFromJSON(m_exec, asObject(element), "d", info.factorCRTExponent)) {
</span><span class="cx"> if (!m_exec->hadException())
</span><del>- throwTypeError(m_exec, "Cannot get factor CRT exponent for a prime in \"oth\" dictionary");
</del><ins>+ throwTypeError(m_exec, ASCIILiteral("Cannot get factor CRT exponent for a prime in \"oth\" dictionary"));
</ins><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx"> if (!getBigIntegerVectorFromJSON(m_exec, asObject(element), "t", info.factorCRTCoefficient)) {
</span><span class="cx"> if (!m_exec->hadException())
</span><del>- throwTypeError(m_exec, "Cannot get factor CRT coefficient for a prime in \"oth\" dictionary");
</del><ins>+ throwTypeError(m_exec, ASCIILiteral("Cannot get factor CRT coefficient for a prime in \"oth\" dictionary"));
</ins><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx"> otherPrimeInfos.append(info);
</span><span class="lines">@@ -484,7 +484,7 @@
</span><span class="cx"> String jwkKeyType;
</span><span class="cx"> if (!getStringFromJSON(m_exec, m_json.get(), "kty", jwkKeyType)) {
</span><span class="cx"> if (!m_exec->hadException())
</span><del>- throwTypeError(m_exec, "Required JWK \"kty\" member is missing");
</del><ins>+ throwTypeError(m_exec, ASCIILiteral("Required JWK \"kty\" member is missing"));
</ins><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -649,7 +649,7 @@
</span><span class="cx">
</span><span class="cx"> if (jwkAlgorithm.isNull()) {
</span><span class="cx"> // The spec doesn't currently tell whether export should fail, or just skip "alg" (which is an optional key in JWK).
</span><del>- throwTypeError(exec, "Key algorithm and size do not map to any JWK algorithm identifier");
</del><ins>+ throwTypeError(exec, ASCIILiteral("Key algorithm and size do not map to any JWK algorithm identifier"));
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -689,7 +689,7 @@
</span><span class="cx"> std::unique_ptr<CryptoKeyData> keyData = key.exportData();
</span><span class="cx"> if (!keyData) {
</span><span class="cx"> // This generally shouldn't happen as long as all key types implement exportData(), but as underlying libraries return errors, there may be some rare failure conditions.
</span><del>- throwTypeError(exec, "Couldn't export key material");
</del><ins>+ throwTypeError(exec, ASCIILiteral("Couldn't export key material"));
</ins><span class="cx"> return String();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -710,7 +710,7 @@
</span><span class="cx"> else if (is<CryptoKeyDataRSAComponents>(*keyData))
</span><span class="cx"> buildJSONForRSAComponents(exec, downcast<CryptoKeyDataRSAComponents>(*keyData), result);
</span><span class="cx"> else {
</span><del>- throwTypeError(exec, "Key doesn't support exportKey");
</del><ins>+ throwTypeError(exec, ASCIILiteral("Key doesn't support exportKey"));
</ins><span class="cx"> return String();
</span><span class="cx"> }
</span><span class="cx"> if (exec->hadException())
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCryptoOperationDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCryptoOperationData.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCryptoOperationData.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/WebCore/bindings/js/JSCryptoOperationData.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> else if (RefPtr<ArrayBufferView> bufferView = toArrayBufferView(value))
</span><span class="cx"> result = std::make_pair(static_cast<uint8_t*>(bufferView->baseAddress()), bufferView->byteLength());
</span><span class="cx"> else {
</span><del>- throwTypeError(exec, "Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData");
</del><ins>+ throwTypeError(exec, ASCIILiteral("Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData"));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> return true;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -374,12 +374,12 @@
</span><span class="cx"> static double enforceRange(ExecState& state, double x, double minimum, double maximum)
</span><span class="cx"> {
</span><span class="cx"> if (std::isnan(x) || std::isinf(x)) {
</span><del>- state.vm().throwException(&state, createTypeError(&state, rangeErrorString(x, minimum, maximum)));
</del><ins>+ throwTypeError(&state, rangeErrorString(x, minimum, maximum));
</ins><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx"> x = trunc(x);
</span><span class="cx"> if (x < minimum || x > maximum) {
</span><del>- state.vm().throwException(&state, createTypeError(&state, rangeErrorString(x, minimum, maximum)));
</del><ins>+ throwTypeError(&state, rangeErrorString(x, minimum, maximum));
</ins><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx"> return x;
</span><span class="lines">@@ -736,7 +736,7 @@
</span><span class="cx">
</span><span class="cx"> static EncodedJSValue throwTypeError(JSC::ExecState& state, const String& errorMessage)
</span><span class="cx"> {
</span><del>- return throwVMError(&state, createTypeError(&state, errorMessage));
</del><ins>+ return throwVMTypeError(&state, errorMessage);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static void appendArgumentMustBe(StringBuilder& builder, unsigned argumentIndex, const char* argumentName, const char* interfaceName, const char* functionName)
</span><span class="lines">@@ -791,7 +791,7 @@
</span><span class="cx"> appendArgumentMustBe(builder, argumentIndex, argumentName, functionInterfaceName, functionName);
</span><span class="cx"> builder.appendLiteral("one of: ");
</span><span class="cx"> builder.append(expectedValues);
</span><del>- return throwTypeError(state, builder.toString());
</del><ins>+ return throwVMTypeError(&state, builder.toString());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> JSC::EncodedJSValue throwArgumentMustBeFunctionError(JSC::ExecState& state, unsigned argumentIndex, const char* argumentName, const char* interfaceName, const char* functionName)
</span><span class="lines">@@ -799,7 +799,7 @@
</span><span class="cx"> StringBuilder builder;
</span><span class="cx"> appendArgumentMustBe(builder, argumentIndex, argumentName, interfaceName, functionName);
</span><span class="cx"> builder.appendLiteral("a function");
</span><del>- return throwTypeError(state, builder.toString());
</del><ins>+ return throwVMTypeError(&state, builder.toString());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> JSC::EncodedJSValue throwArgumentTypeError(JSC::ExecState& state, unsigned argumentIndex, const char* argumentName, const char* functionInterfaceName, const char* functionName, const char* expectedType)
</span><span class="lines">@@ -808,12 +808,12 @@
</span><span class="cx"> appendArgumentMustBe(builder, argumentIndex, argumentName, functionInterfaceName, functionName);
</span><span class="cx"> builder.appendLiteral("an instance of ");
</span><span class="cx"> builder.append(expectedType);
</span><del>- return throwTypeError(state, builder.toString());
</del><ins>+ return throwVMTypeError(&state, builder.toString());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void throwArrayElementTypeError(JSC::ExecState& state)
</span><span class="cx"> {
</span><del>- throwTypeError(state, "Invalid Array element type");
</del><ins>+ throwTypeError(state, ASCIILiteral("Invalid Array element type"));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void throwAttributeTypeError(JSC::ExecState& state, const char* interfaceName, const char* attributeName, const char* expectedType)
</span><span class="lines">@@ -829,7 +829,7 @@
</span><span class="cx">
</span><span class="cx"> JSC::EncodedJSValue throwGetterTypeError(JSC::ExecState& state, const char* interfaceName, const char* attributeName)
</span><span class="cx"> {
</span><del>- return throwTypeError(state, makeString("The ", interfaceName, '.', attributeName, " getter can only be used on instances of ", interfaceName));
</del><ins>+ return throwVMTypeError(&state, makeString("The ", interfaceName, '.', attributeName, " getter can only be used on instances of ", interfaceName));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void throwSequenceTypeError(JSC::ExecState& state)
</span><span class="lines">@@ -850,7 +850,7 @@
</span><span class="cx">
</span><span class="cx"> EncodedJSValue throwThisTypeError(JSC::ExecState& state, const char* interfaceName, const char* functionName)
</span><span class="cx"> {
</span><del>- return throwTypeError(state, makeString("Can only call ", interfaceName, '.', functionName, " on instances of ", interfaceName));
</del><ins>+ return throwVMTypeError(&state, makeString("Can only call ", interfaceName, '.', functionName, " on instances of ", interfaceName));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void callFunctionWithCurrentArguments(JSC::ExecState& state, JSC::JSObject& thisObject, JSC::JSFunction& function)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDataCueCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDataCueCustom.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDataCueCustom.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/WebCore/bindings/js/JSDataCueCustom.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx"> #if ENABLE(DATACUE_VALUE)
</span><span class="cx"> if (exec->argumentCount() > 3) {
</span><span class="cx"> if (!exec->argument(3).isString())
</span><del>- return throwVMError(exec, createTypeError(exec, "Second argument of the constructor is not of type String"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Second argument of the constructor is not of type String"));
</ins><span class="cx"> type = exec->argument(3).getString(exec);
</span><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDocumentCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -154,7 +154,7 @@
</span><span class="cx"> JSObject* object = state.argument(1).getObject();
</span><span class="cx"> ConstructData callData;
</span><span class="cx"> if (!object || object->methodTable()->getConstructData(object, callData) == ConstructType::None)
</span><del>- return throwTypeError(&state, "The second argument must be a constructor");
</del><ins>+ return throwTypeError(&state, ASCIILiteral("The second argument must be a constructor"));
</ins><span class="cx">
</span><span class="cx"> Document& document = wrapped();
</span><span class="cx"> if (!document.domWindow()) {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSFileCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSFileCustom.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSFileCustom.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/WebCore/bindings/js/JSFileCustom.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx">
</span><span class="cx"> JSValue arg = exec->argument(0);
</span><span class="cx"> if (arg.isUndefinedOrNull())
</span><del>- return throwVMError(exec, createTypeError(exec, "First argument to File constructor must be a valid sequence, was undefined or null"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("First argument to File constructor must be a valid sequence, was undefined or null"));
</ins><span class="cx">
</span><span class="cx"> unsigned blobPartsLength = 0;
</span><span class="cx"> JSObject* blobParts = toJSSequence(exec, arg, blobPartsLength);
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx">
</span><span class="cx"> arg = exec->argument(1);
</span><span class="cx"> if (arg.isUndefined())
</span><del>- return throwVMError(exec, createTypeError(exec, "Second argument to File constructor must be a valid string, was undefined"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Second argument to File constructor must be a valid string, was undefined"));
</ins><span class="cx">
</span><span class="cx"> String filename = arg.toWTFString(exec).replace('/', ':');
</span><span class="cx"> if (exec->hadException())
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx"> if (!arg.isUndefinedOrNull()) {
</span><span class="cx"> JSObject* filePropertyBagObject = arg.getObject();
</span><span class="cx"> if (!filePropertyBagObject)
</span><del>- return throwVMError(exec, createTypeError(exec, "Third argument of the constructor is not of type Object"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Third argument of the constructor is not of type Object"));
</ins><span class="cx">
</span><span class="cx"> // Create the dictionary wrapper from the initializer object.
</span><span class="cx"> JSDictionary dictionary(exec, filePropertyBagObject);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSModuleLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSModuleLoader.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSModuleLoader.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/WebCore/bindings/js/JSModuleLoader.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -116,10 +116,10 @@
</span><span class="cx"> else if (moduleKeyValue.isString())
</span><span class="cx"> sourceUrl = URL(URL(), asString(moduleKeyValue)->value(exec));
</span><span class="cx"> else
</span><del>- return JSC::throwTypeError(exec, "Module key is not Symbol or String.");
</del><ins>+ return JSC::throwTypeError(exec, ASCIILiteral("Module key is not Symbol or String."));
</ins><span class="cx">
</span><span class="cx"> if (!sourceUrl.isValid())
</span><del>- return JSC::throwTypeError(exec, "Module key is an invalid URL.");
</del><ins>+ return JSC::throwTypeError(exec, ASCIILiteral("Module key is an invalid URL."));
</ins><span class="cx">
</span><span class="cx"> // FIXME: Implement evaluating module code.
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSMutationObserverCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSMutationObserverCustom.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSMutationObserverCustom.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/WebCore/bindings/js/JSMutationObserverCustom.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx"> JSObject* object = exec->argument(0).getObject();
</span><span class="cx"> CallData callData;
</span><span class="cx"> if (!object || object->methodTable()->getCallData(object, callData) == CallType::None)
</span><del>- return throwVMError(exec, createTypeError(exec, "Callback argument must be a function"));
</del><ins>+ return throwVMTypeError(exec, ASCIILiteral("Callback argument must be a function"));
</ins><span class="cx">
</span><span class="cx"> DOMConstructorObject* jsConstructor = jsCast<DOMConstructorObject*>(exec->callee());
</span><span class="cx"> auto callback = JSMutationCallback::create(object, jsConstructor->globalObject());
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSOscillatorNodeCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSOscillatorNodeCustom.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSOscillatorNodeCustom.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/WebCore/bindings/js/JSOscillatorNodeCustom.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> if (value.isNumber()) {
</span><span class="cx"> uint32_t type = value.toUInt32(&state);
</span><span class="cx"> if (!imp.setType(type))
</span><del>- state.vm().throwException(&state, createTypeError(&state, "Illegal OscillatorNode type"));
</del><ins>+ throwTypeError(&state, ASCIILiteral("Illegal OscillatorNode type"));
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- state.vm().throwException(&state, createTypeError(&state, "Illegal OscillatorNode type"));
</del><ins>+ throwTypeError(&state, ASCIILiteral("Illegal OscillatorNode type"));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSPannerNodeCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSPannerNodeCustom.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSPannerNodeCustom.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/WebCore/bindings/js/JSPannerNodeCustom.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> if (value.isNumber()) {
</span><span class="cx"> uint32_t model = value.toUInt32(&state);
</span><span class="cx"> if (!imp.setPanningModel(model))
</span><del>- state.vm().throwException(&state, createTypeError(&state, "Illegal panningModel"));
</del><ins>+ throwTypeError(&state, ASCIILiteral("Illegal panningModel"));
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- state.vm().throwException(&state, createTypeError(&state, "Illegal panningModel"));
</del><ins>+ throwTypeError(&state, ASCIILiteral("Illegal panningModel"));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void JSPannerNode::setDistanceModel(ExecState& state, JSValue value)
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx"> if (value.isNumber()) {
</span><span class="cx"> uint32_t model = value.toUInt32(&state);
</span><span class="cx"> if (!imp.setDistanceModel(model))
</span><del>- state.vm().throwException(&state, createTypeError(&state, "Illegal distanceModel"));
</del><ins>+ throwTypeError(&state, ASCIILiteral("Illegal distanceModel"));
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="lines">@@ -82,7 +82,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- state.vm().throwException(&state, createTypeError(&state, "Illegal distanceModel"));
</del><ins>+ throwTypeError(&state, ASCIILiteral("Illegal distanceModel"));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSReadableStreamPrivateConstructorscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx"> // Public JS ReadableStreamReder and ReadableStreamController constructor callbacks.
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL constructJSReadableStreamController(ExecState* state)
</span><span class="cx"> {
</span><del>- return throwVMError(state, createTypeError(state, ASCIILiteral("ReadableStreamController constructor should not be called directly")));
</del><ins>+ return throwVMTypeError(state, ASCIILiteral("ReadableStreamController constructor should not be called directly"));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL constructJSReadableStreamReader(ExecState* state)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx"> {
</span><span class="cx"> JSReadableStream* stream = jsDynamicCast<JSReadableStream*>(state->argument(0));
</span><span class="cx"> if (!stream)
</span><del>- return throwVMError(state, createTypeError(state, ASCIILiteral("ReadableStreamReader constructor parameter is not a ReadableStream")));
</del><ins>+ return throwVMTypeError(state, ASCIILiteral("ReadableStreamReader constructor parameter is not a ReadableStream"));
</ins><span class="cx">
</span><span class="cx"> JSValue jsFunction = stream->get(state, Identifier::fromString(state, "getReader"));
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSSubtleCryptoCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx"> else if (keyFormatString == "jwk")
</span><span class="cx"> result = CryptoKeyFormat::JWK;
</span><span class="cx"> else {
</span><del>- throwTypeError(&state, "Unknown key format");
</del><ins>+ throwTypeError(&state, ASCIILiteral("Unknown key format"));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx"> return true;
</span><span class="lines">@@ -453,7 +453,7 @@
</span><span class="cx"> case CryptoKeyFormat::JWK: {
</span><span class="cx"> String jwkString = String::fromUTF8(data.first, data.second);
</span><span class="cx"> if (jwkString.isNull()) {
</span><del>- throwTypeError(&state, "JWK JSON serialization is not valid UTF-8");
</del><ins>+ throwTypeError(&state, ASCIILiteral("JWK JSON serialization is not valid UTF-8"));
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> keySerialization = std::make_unique<JSCryptoKeySerializationJWK>(&state, jwkString);
</span><span class="lines">@@ -462,7 +462,7 @@
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> default:
</span><del>- throwTypeError(&state, "Unsupported key format for import");
</del><ins>+ throwTypeError(&state, ASCIILiteral("Unsupported key format for import"));
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -470,7 +470,7 @@
</span><span class="cx">
</span><span class="cx"> if (!keySerialization->reconcileAlgorithm(algorithm, parameters)) {
</span><span class="cx"> if (!state.hadException())
</span><del>- throwTypeError(&state, "Algorithm specified in key is not compatible with one passed to importKey as argument");
</del><ins>+ throwTypeError(&state, ASCIILiteral("Algorithm specified in key is not compatible with one passed to importKey as argument"));
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> if (state.hadException())
</span><span class="lines">@@ -477,7 +477,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> if (!algorithm) {
</span><del>- throwTypeError(&state, "Neither key nor function argument has crypto algorithm specified");
</del><ins>+ throwTypeError(&state, ASCIILiteral("Neither key nor function argument has crypto algorithm specified"));
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> ASSERT(parameters);
</span><span class="lines">@@ -566,7 +566,7 @@
</span><span class="cx"> static void exportKey(ExecState& state, CryptoKeyFormat keyFormat, const CryptoKey& key, CryptoAlgorithm::VectorCallback callback, CryptoAlgorithm::VoidCallback failureCallback)
</span><span class="cx"> {
</span><span class="cx"> if (!key.extractable()) {
</span><del>- throwTypeError(&state, "Key is not extractable");
</del><ins>+ throwTypeError(&state, ASCIILiteral("Key is not extractable"));
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -590,7 +590,7 @@
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> default:
</span><del>- throwTypeError(&state, "Unsupported key format for export");
</del><ins>+ throwTypeError(&state, ASCIILiteral("Unsupported key format for export"));
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsReadableStreamControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/ReadableStreamController.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/ReadableStreamController.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/WebCore/bindings/js/ReadableStreamController.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx">
</span><span class="cx"> if (!function.isFunction()) {
</span><span class="cx"> if (!function.isUndefined())
</span><del>- throwVMError(&state, createTypeError(&state, ASCIILiteral("ReadableStream trying to call a property that is not callable")));
</del><ins>+ throwTypeError(&state, ASCIILiteral("ReadableStream trying to call a property that is not callable"));
</ins><span class="cx"> return JSC::jsUndefined();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsSerializedScriptValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -1569,7 +1569,7 @@
</span><span class="cx">
</span><span class="cx"> void throwValidationError()
</span><span class="cx"> {
</span><del>- m_exec->vm().throwException(m_exec, createTypeError(m_exec, "Unable to deserialize data."));
</del><ins>+ throwTypeError(m_exec, ASCIILiteral("Unable to deserialize data."));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool isValid() const { return m_version <= CurrentVersion; }
</span><span class="lines">@@ -2763,7 +2763,7 @@
</span><span class="cx"> exec->vm().throwException(exec, createStackOverflowError(exec));
</span><span class="cx"> break;
</span><span class="cx"> case ValidationError:
</span><del>- exec->vm().throwException(exec, createTypeError(exec, "Unable to deserialize data."));
</del><ins>+ throwTypeError(exec, ASCIILiteral("Unable to deserialize data."));
</ins><span class="cx"> break;
</span><span class="cx"> case DataCloneError:
</span><span class="cx"> setDOMException(exec, DATA_CLONE_ERR);
</span></span></pre></div>
<a id="trunkSourceWebCorebridgecc_instancecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bridge/c/c_instance.cpp (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bridge/c/c_instance.cpp        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/WebCore/bridge/c/c_instance.cpp        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -155,7 +155,7 @@
</span><span class="cx"> JSValue CInstance::invokeMethod(ExecState* exec, RuntimeMethod* runtimeMethod)
</span><span class="cx"> {
</span><span class="cx"> if (!asObject(runtimeMethod)->inherits(CRuntimeMethod::info()))
</span><del>- return exec->vm().throwException(exec, createTypeError(exec, "Attempt to invoke non-plug-in method on plug-in object."));
</del><ins>+ return throwTypeError(exec, "Attempt to invoke non-plug-in method on plug-in object.");
</ins><span class="cx">
</span><span class="cx"> CMethod* method = static_cast<CMethod*>(runtimeMethod->method());
</span><span class="cx"> ASSERT(method);
</span></span></pre></div>
<a id="trunkSourceWebCorebridgeobjcobjc_instancemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bridge/objc/objc_instance.mm (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bridge/objc/objc_instance.mm        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/WebCore/bridge/objc/objc_instance.mm        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -206,7 +206,7 @@
</span><span class="cx"> JSC::JSValue ObjcInstance::invokeMethod(ExecState* exec, RuntimeMethod* runtimeMethod)
</span><span class="cx"> {
</span><span class="cx"> if (!asObject(runtimeMethod)->inherits(ObjCRuntimeMethod::info()))
</span><del>- return exec->vm().throwException(exec, createTypeError(exec, "Attempt to invoke non-plug-in method on plug-in object."));
</del><ins>+ return throwTypeError(exec, ASCIILiteral("Attempt to invoke non-plug-in method on plug-in object."));
</ins><span class="cx">
</span><span class="cx"> ObjcMethod *method = static_cast<ObjcMethod*>(runtimeMethod->method());
</span><span class="cx"> ASSERT(method);
</span></span></pre></div>
<a id="trunkSourceWebCorebridgeobjcobjc_runtimemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bridge/objc/objc_runtime.mm (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bridge/objc/objc_runtime.mm        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/WebCore/bridge/objc/objc_runtime.mm        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -157,7 +157,7 @@
</span><span class="cx"> bool ObjcArray::setValueAt(ExecState* exec, unsigned int index, JSValue aValue) const
</span><span class="cx"> {
</span><span class="cx"> if (![_array.get() respondsToSelector:@selector(insertObject:atIndex:)]) {
</span><del>- exec->vm().throwException(exec, createTypeError(exec, "Array is not mutable."));
</del><ins>+ throwTypeError(exec, ASCIILiteral("Array is not mutable."));
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/WebKit/mac/ChangeLog        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-07-06 Benjamin Poulain <bpoulain@apple.com>
+
+ [JSC] Unify how we throw TypeError from C++
+ https://bugs.webkit.org/show_bug.cgi?id=159500
+
+ Reviewed by Saam Barati.
+
+ * Plugins/Hosted/ProxyInstance.mm:
+ (WebKit::ProxyInstance::invokeMethod):
+
</ins><span class="cx"> 2016-07-01 Youenn Fablet <youennf@gmail.com>
</span><span class="cx">
</span><span class="cx"> Add a runtime flag for DOM iterators
</span></span></pre></div>
<a id="trunkSourceWebKitmacPluginsHostedProxyInstancemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Plugins/Hosted/ProxyInstance.mm (202889 => 202890)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Plugins/Hosted/ProxyInstance.mm        2016-07-07 03:03:42 UTC (rev 202889)
+++ trunk/Source/WebKit/mac/Plugins/Hosted/ProxyInstance.mm        2016-07-07 03:12:37 UTC (rev 202890)
</span><span class="lines">@@ -220,7 +220,7 @@
</span><span class="cx"> JSValue ProxyInstance::invokeMethod(ExecState* exec, JSC::RuntimeMethod* runtimeMethod)
</span><span class="cx"> {
</span><span class="cx"> if (!asObject(runtimeMethod)->inherits(ProxyRuntimeMethod::info()))
</span><del>- return exec->vm().throwException(exec, createTypeError(exec, "Attempt to invoke non-plug-in method on plug-in object."));
</del><ins>+ return throwTypeError(exec, ASCIILiteral("Attempt to invoke non-plug-in method on plug-in object."));
</ins><span class="cx">
</span><span class="cx"> ProxyMethod* method = static_cast<ProxyMethod*>(runtimeMethod->method());
</span><span class="cx"> ASSERT(method);
</span></span></pre>
</div>
</div>
</body>
</html>