<!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>[181889] trunk</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/181889">181889</a></dd>
<dt>Author</dt> <dd>saambarati1@gmail.com</dd>
<dt>Date</dt> <dd>2015-03-24 00:30:05 -0700 (Tue, 24 Mar 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Improve error messages in JSC
https://bugs.webkit.org/show_bug.cgi?id=141869

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

JavaScriptCore has some unintuitive error messages associated
with certain common errors. This patch changes some specific
error messages to be more understandable and also creates a
mechanism that will allow for easy modification of error messages
in the future. The specific errors we change are not a function
errors and invalid parameter errors.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* interpreter/Interpreter.cpp:
(JSC::sizeOfVarargs):
* jit/JITOperations.cpp:
op_throw_static_error always has a JSString as its argument.
There is no need to dance around this, and we should assert
that this always holds. This JSString represents the error
message we want to display to the user, so there is no need
to pass it into errorDescriptionForValue which will now place
quotes around the string.

* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:
(JSC::CommonSlowPaths::opIn):
* runtime/ErrorInstance.cpp:
(JSC::ErrorInstance::ErrorInstance):
* runtime/ErrorInstance.h:
(JSC::ErrorInstance::hasSourceAppender):
(JSC::ErrorInstance::sourceAppender):
(JSC::ErrorInstance::setSourceAppender):
(JSC::ErrorInstance::clearSourceAppender):
(JSC::ErrorInstance::setRuntimeTypeForCause):
(JSC::ErrorInstance::runtimeTypeForCause):
(JSC::ErrorInstance::clearRuntimeTypeForCause):
(JSC::ErrorInstance::appendSourceToMessage): Deleted.
(JSC::ErrorInstance::setAppendSourceToMessage): Deleted.
(JSC::ErrorInstance::clearAppendSourceToMessage): Deleted.
* runtime/ExceptionHelpers.cpp:
(JSC::errorDescriptionForValue):
(JSC::defaultApproximateSourceError):
(JSC::defaultSourceAppender):
(JSC::functionCallBase):
(JSC::notAFunctionSourceAppender):
(JSC::invalidParameterInSourceAppender):
(JSC::invalidParameterInstanceofSourceAppender):
(JSC::createError):
(JSC::createInvalidFunctionApplyParameterError):
(JSC::createInvalidInParameterError):
(JSC::createInvalidInstanceofParameterError):
(JSC::createNotAConstructorError):
(JSC::createNotAFunctionError):
(JSC::createNotAnObjectError):
(JSC::createInvalidParameterError): Deleted.
* runtime/ExceptionHelpers.h:
* runtime/JSObject.cpp:
(JSC::JSObject::hasInstance):
* runtime/RuntimeType.cpp: Added.
(JSC::runtimeTypeForValue):
(JSC::runtimeTypeAsString):
* runtime/RuntimeType.h: Added.
* runtime/TypeProfilerLog.cpp:
(JSC::TypeProfilerLog::processLogEntries):
* runtime/TypeSet.cpp:
(JSC::TypeSet::getRuntimeTypeForValue): Deleted.
* runtime/TypeSet.h:
* runtime/VM.cpp:
(JSC::appendSourceToError):
(JSC::VM::throwException):

LayoutTests:

* fast/dom/NodeList/nodelist-item-call-as-function-expected.txt:
* fast/dom/call-a-constructor-as-a-function-expected.txt:
* fast/regex/dom/cross-frame-callable-expected.txt:
* fast/selectors/closest-general-expected.txt:
* http/tests/security/xss-DENIED-window-index-assign-expected.txt:
* js/dom/exception-thrown-from-new-expected.txt:
* js/exception-for-nonobject-expected.txt:
* js/exception-function-apply-expected.txt: Added.
* js/exception-function-apply.html: Added.
* js/exception-in-expected.txt: Added.
* js/exception-in.html: Added.
* js/exception-instanceof-expected.txt: Added.
* js/exception-instanceof.html: Added.
* js/instance-of-immediates-expected.txt:
* js/script-tests/exception-function-apply.js: Added.
* js/script-tests/exception-in.js: Added.
* js/script-tests/exception-instanceof.js: Added.
* js/typedarray-constructors-expected.txt:
* platform/mac-wk2/plugins/npruntime/object-from-destroyed-plugin-expected.txt:
* platform/mac-wk2/plugins/npruntime/object-from-destroyed-plugin-in-subframe-expected.txt:
* platform/mac/css3/selectors3/xhtml/css3-modsel-15c-expected.txt:
* platform/mac/css3/selectors3/xml/css3-modsel-15c-expected.txt:
* plugins/npruntime/object-from-destroyed-plugin-expected.txt:
* plugins/npruntime/object-from-destroyed-plugin-in-subframe-expected.txt:
* plugins/npruntime/plugin-scriptable-object-invoke-default-expected.txt:
* sputnik/Conformance/12_Statement/12.1_Block/S12.1_A4_T1-expected.txt:
* sputnik/Conformance/13_Function_Definition/S13_A17_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object/S15.1_A2_T1-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.2_Object/15.2.4/S15.2.4_A3-expected.txt:
* svg/dom/svgpath-out-of-bounds-getPathSeg-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastdomNodeListnodelistitemcallasfunctionexpectedtxt">trunk/LayoutTests/fast/dom/NodeList/nodelist-item-call-as-function-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomcallaconstructorasafunctionexpectedtxt">trunk/LayoutTests/fast/dom/call-a-constructor-as-a-function-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastregexdomcrossframecallableexpectedtxt">trunk/LayoutTests/fast/regex/dom/cross-frame-callable-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastselectorsclosestgeneralexpectedtxt">trunk/LayoutTests/fast/selectors/closest-general-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityxssDENIEDwindowindexassignexpectedtxt">trunk/LayoutTests/http/tests/security/xss-DENIED-window-index-assign-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomexceptionthrownfromnewexpectedtxt">trunk/LayoutTests/js/dom/exception-thrown-from-new-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsexceptionfornonobjectexpectedtxt">trunk/LayoutTests/js/exception-for-nonobject-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsinstanceofimmediatesexpectedtxt">trunk/LayoutTests/js/instance-of-immediates-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjstypedarrayconstructorsexpectedtxt">trunk/LayoutTests/js/typedarray-constructors-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss3selectors3xhtmlcss3modsel15cexpectedtxt">trunk/LayoutTests/platform/mac/css3/selectors3/xhtml/css3-modsel-15c-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss3selectors3xmlcss3modsel15cexpectedtxt">trunk/LayoutTests/platform/mac/css3/selectors3/xml/css3-modsel-15c-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2pluginsnpruntimeobjectfromdestroyedpluginexpectedtxt">trunk/LayoutTests/platform/mac-wk2/plugins/npruntime/object-from-destroyed-plugin-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2pluginsnpruntimeobjectfromdestroyedplugininsubframeexpectedtxt">trunk/LayoutTests/platform/mac-wk2/plugins/npruntime/object-from-destroyed-plugin-in-subframe-expected.txt</a></li>
<li><a href="#trunkLayoutTestspluginsnpruntimeobjectfromdestroyedpluginexpectedtxt">trunk/LayoutTests/plugins/npruntime/object-from-destroyed-plugin-expected.txt</a></li>
<li><a href="#trunkLayoutTestspluginsnpruntimeobjectfromdestroyedplugininsubframeexpectedtxt">trunk/LayoutTests/plugins/npruntime/object-from-destroyed-plugin-in-subframe-expected.txt</a></li>
<li><a href="#trunkLayoutTestspluginsnpruntimepluginscriptableobjectinvokedefaultexpectedtxt">trunk/LayoutTests/plugins/npruntime/plugin-scriptable-object-invoke-default-expected.txt</a></li>
<li><a href="#trunkLayoutTestssputnikConformance12_Statement121_BlockS121_A4_T1expectedtxt">trunk/LayoutTests/sputnik/Conformance/12_Statement/12.1_Block/S12.1_A4_T1-expected.txt</a></li>
<li><a href="#trunkLayoutTestssputnikConformance13_Function_DefinitionS13_A17_T2expectedtxt">trunk/LayoutTests/sputnik/Conformance/13_Function_Definition/S13_A17_T2-expected.txt</a></li>
<li><a href="#trunkLayoutTestssputnikConformance15_Native_Objects151_The_Global_ObjectS151_A2_T1expectedtxt">trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object/S15.1_A2_T1-expected.txt</a></li>
<li><a href="#trunkLayoutTestssputnikConformance15_Native_Objects152_Object1524S1524_A3expectedtxt">trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.2_Object/15.2.4/S15.2.4_A3-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgdomsvgpathoutofboundsgetPathSegexpectedtxt">trunk/LayoutTests/svg/dom/svgpath-out-of-bounds-getPathSeg-expected.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreCMakeListstxt">trunk/Source/JavaScriptCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj">trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters">trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</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="#trunkSourceJavaScriptCorellintLLIntSlowPathscpp">trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCommonSlowPathsh">trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeErrorInstancecpp">trunk/Source/JavaScriptCore/runtime/ErrorInstance.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeErrorInstanceh">trunk/Source/JavaScriptCore/runtime/ErrorInstance.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeExceptionHelperscpp">trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeExceptionHelpersh">trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSObjectcpp">trunk/Source/JavaScriptCore/runtime/JSObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeTypeProfilerLogcpp">trunk/Source/JavaScriptCore/runtime/TypeProfilerLog.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeTypeSetcpp">trunk/Source/JavaScriptCore/runtime/TypeSet.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeTypeSeth">trunk/Source/JavaScriptCore/runtime/TypeSet.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeVMcpp">trunk/Source/JavaScriptCore/runtime/VM.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsjsexceptionfunctionapplyexpectedtxt">trunk/LayoutTests/js/exception-function-apply-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsexceptionfunctionapplyhtml">trunk/LayoutTests/js/exception-function-apply.html</a></li>
<li><a href="#trunkLayoutTestsjsexceptioninexpectedtxt">trunk/LayoutTests/js/exception-in-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsexceptioninhtml">trunk/LayoutTests/js/exception-in.html</a></li>
<li><a href="#trunkLayoutTestsjsexceptioninstanceofexpectedtxt">trunk/LayoutTests/js/exception-instanceof-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsexceptioninstanceofhtml">trunk/LayoutTests/js/exception-instanceof.html</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsexceptionfunctionapplyjs">trunk/LayoutTests/js/script-tests/exception-function-apply.js</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsexceptioninjs">trunk/LayoutTests/js/script-tests/exception-in.js</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsexceptioninstanceofjs">trunk/LayoutTests/js/script-tests/exception-instanceof.js</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeRuntimeTypecpp">trunk/Source/JavaScriptCore/runtime/RuntimeType.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeRuntimeTypeh">trunk/Source/JavaScriptCore/runtime/RuntimeType.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/LayoutTests/ChangeLog        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2015-03-24  Saam Barati  &lt;saambarati1@gmail.com&gt;
+
+        Improve error messages in JSC
+        https://bugs.webkit.org/show_bug.cgi?id=141869
+
+        Reviewed by Geoffrey Garen.
+
+        * fast/dom/NodeList/nodelist-item-call-as-function-expected.txt:
+        * fast/dom/call-a-constructor-as-a-function-expected.txt:
+        * fast/regex/dom/cross-frame-callable-expected.txt:
+        * fast/selectors/closest-general-expected.txt:
+        * http/tests/security/xss-DENIED-window-index-assign-expected.txt:
+        * js/dom/exception-thrown-from-new-expected.txt:
+        * js/exception-for-nonobject-expected.txt:
+        * js/exception-function-apply-expected.txt: Added.
+        * js/exception-function-apply.html: Added.
+        * js/exception-in-expected.txt: Added.
+        * js/exception-in.html: Added.
+        * js/exception-instanceof-expected.txt: Added.
+        * js/exception-instanceof.html: Added.
+        * js/instance-of-immediates-expected.txt:
+        * js/script-tests/exception-function-apply.js: Added.
+        * js/script-tests/exception-in.js: Added.
+        * js/script-tests/exception-instanceof.js: Added.
+        * js/typedarray-constructors-expected.txt:
+        * platform/mac-wk2/plugins/npruntime/object-from-destroyed-plugin-expected.txt:
+        * platform/mac-wk2/plugins/npruntime/object-from-destroyed-plugin-in-subframe-expected.txt:
+        * platform/mac/css3/selectors3/xhtml/css3-modsel-15c-expected.txt:
+        * platform/mac/css3/selectors3/xml/css3-modsel-15c-expected.txt:
+        * plugins/npruntime/object-from-destroyed-plugin-expected.txt:
+        * plugins/npruntime/object-from-destroyed-plugin-in-subframe-expected.txt:
+        * plugins/npruntime/plugin-scriptable-object-invoke-default-expected.txt:
+        * sputnik/Conformance/12_Statement/12.1_Block/S12.1_A4_T1-expected.txt:
+        * sputnik/Conformance/13_Function_Definition/S13_A17_T2-expected.txt:
+        * sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object/S15.1_A2_T1-expected.txt:
+        * sputnik/Conformance/15_Native_Objects/15.2_Object/15.2.4/S15.2.4_A3-expected.txt:
+        * svg/dom/svgpath-out-of-bounds-getPathSeg-expected.txt:
+
</ins><span class="cx"> 2015-03-23  Yoav Weiss  &lt;yoav@yoav.ws&gt;
</span><span class="cx"> 
</span><span class="cx">         Update empty image canvas tests and fix a related bug
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomNodeListnodelistitemcallasfunctionexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/NodeList/nodelist-item-call-as-function-expected.txt (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/NodeList/nodelist-item-call-as-function-expected.txt        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/LayoutTests/fast/dom/NodeList/nodelist-item-call-as-function-expected.txt        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-PASS nodeList(0) threw exception TypeError: NodeList is not a function (evaluating 'nodeList(0)').
</del><ins>+PASS nodeList(0) threw exception TypeError: nodeList is not a function. (In 'nodeList(0)', 'nodeList' is an instance of NodeList).
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomcallaconstructorasafunctionexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/dom/call-a-constructor-as-a-function-expected.txt (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/call-a-constructor-as-a-function-expected.txt        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/LayoutTests/fast/dom/call-a-constructor-as-a-function-expected.txt        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -4,19 +4,19 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> SKIP AudioContext is not implemented.
</span><del>-PASS FormData() threw exception TypeError: FormDataConstructor is not a function (evaluating 'FormData()').
-PASS EventSource() threw exception TypeError: EventSourceConstructor is not a function (evaluating 'EventSource()').
-PASS FileReader() threw exception TypeError: FileReaderConstructor is not a function (evaluating 'FileReader()').
-PASS Audio() threw exception TypeError: AudioConstructor is not a function (evaluating 'Audio()').
-PASS Image() threw exception TypeError: ImageConstructor is not a function (evaluating 'Image()').
-PASS Option() threw exception TypeError: OptionConstructor is not a function (evaluating 'Option()').
-PASS MessageChannel() threw exception TypeError: MessageChannelConstructor is not a function (evaluating 'MessageChannel()').
-PASS WebKitCSSMatrix() threw exception TypeError: WebKitCSSMatrixConstructor is not a function (evaluating 'WebKitCSSMatrix()').
-PASS WebKitPoint() threw exception TypeError: WebKitPointConstructor is not a function (evaluating 'WebKitPoint()').
-PASS WebSocket() threw exception TypeError: WebSocketConstructor is not a function (evaluating 'WebSocket()').
-PASS Worker() threw exception TypeError: WorkerConstructor is not a function (evaluating 'Worker()').
-PASS XMLHttpRequest() threw exception TypeError: XMLHttpRequestConstructor is not a function (evaluating 'XMLHttpRequest()').
-PASS XSLTProcessor() threw exception TypeError: XSLTProcessorConstructor is not a function (evaluating 'XSLTProcessor()').
</del><ins>+PASS FormData() threw exception TypeError: FormData is not a function. (In 'FormData()', 'FormData' is an instance of FormDataConstructor).
+PASS EventSource() threw exception TypeError: EventSource is not a function. (In 'EventSource()', 'EventSource' is an instance of EventSourceConstructor).
+PASS FileReader() threw exception TypeError: FileReader is not a function. (In 'FileReader()', 'FileReader' is an instance of FileReaderConstructor).
+PASS Audio() threw exception TypeError: Audio is not a function. (In 'Audio()', 'Audio' is an instance of AudioConstructor).
+PASS Image() threw exception TypeError: Image is not a function. (In 'Image()', 'Image' is an instance of ImageConstructor).
+PASS Option() threw exception TypeError: Option is not a function. (In 'Option()', 'Option' is an instance of OptionConstructor).
+PASS MessageChannel() threw exception TypeError: MessageChannel is not a function. (In 'MessageChannel()', 'MessageChannel' is an instance of MessageChannelConstructor).
+PASS WebKitCSSMatrix() threw exception TypeError: WebKitCSSMatrix is not a function. (In 'WebKitCSSMatrix()', 'WebKitCSSMatrix' is an instance of WebKitCSSMatrixConstructor).
+PASS WebKitPoint() threw exception TypeError: WebKitPoint is not a function. (In 'WebKitPoint()', 'WebKitPoint' is an instance of WebKitPointConstructor).
+PASS WebSocket() threw exception TypeError: WebSocket is not a function. (In 'WebSocket()', 'WebSocket' is an instance of WebSocketConstructor).
+PASS Worker() threw exception TypeError: Worker is not a function. (In 'Worker()', 'Worker' is an instance of WorkerConstructor).
+PASS XMLHttpRequest() threw exception TypeError: XMLHttpRequest is not a function. (In 'XMLHttpRequest()', 'XMLHttpRequest' is an instance of XMLHttpRequestConstructor).
+PASS XSLTProcessor() threw exception TypeError: XSLTProcessor is not a function. (In 'XSLTProcessor()', 'XSLTProcessor' is an instance of XSLTProcessorConstructor).
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastregexdomcrossframecallableexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/regex/dom/cross-frame-callable-expected.txt (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/regex/dom/cross-frame-callable-expected.txt        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/LayoutTests/fast/regex/dom/cross-frame-callable-expected.txt        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-PASS re('a') threw exception TypeError: RegExp is not a function (evaluating 're('a')').
</del><ins>+PASS re('a') threw exception TypeError: re is not a function. (In 're('a')', 're' is an instance of RegExp).
</ins><span class="cx"> PASS re.exec('a') is ['a']
</span><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfastselectorsclosestgeneralexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/selectors/closest-general-expected.txt (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/selectors/closest-general-expected.txt        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/LayoutTests/fast/selectors/closest-general-expected.txt        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx"> PASS sour.closest(&quot;b, a&quot;) is b
</span><span class="cx"> PASS sour.closest(&quot;a&quot;) is a
</span><span class="cx"> PASS document.closest is undefined
</span><del>-PASS document.closest() threw exception TypeError: undefined is not a function (evaluating 'document.closest()').
</del><ins>+PASS document.closest() threw exception TypeError: document.closest is not a function. (In 'document.closest()', 'document.closest' is undefined).
</ins><span class="cx"> PASS theTarget.closest() threw exception TypeError: Not enough arguments.
</span><span class="cx"> PASS theTarget.closest(&quot;&quot;) threw exception Error: SyntaxError: DOM Exception 12.
</span><span class="cx"> PASS theTarget.closest(&quot;.123&quot;) threw exception Error: SyntaxError: DOM Exception 12.
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityxssDENIEDwindowindexassignexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/xss-DENIED-window-index-assign-expected.txt (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/xss-DENIED-window-index-assign-expected.txt        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/LayoutTests/http/tests/security/xss-DENIED-window-index-assign-expected.txt        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><span class="cx"> ALERT: undefined
</span><del>-CONSOLE MESSAGE: line 1: TypeError: undefined is not a function (evaluating 'parent[0].f()')
</del><ins>+CONSOLE MESSAGE: line 1: TypeError: parent[0].f is not a function. (In 'parent[0].f()', 'parent[0].f' is undefined)
</ins><span class="cx"> 
</span><span class="cx"> This test passes if the access is forbidden.
</span></span></pre></div>
<a id="trunkLayoutTestsjsdomexceptionthrownfromnewexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/dom/exception-thrown-from-new-expected.txt (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/exception-thrown-from-new-expected.txt        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/LayoutTests/js/dom/exception-thrown-from-new-expected.txt        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> This page tests exceptions thrown from 'new' expressions. If the test passes, you'll see a series of PASS messages below.
</span><span class="cx"> 
</span><span class="cx"> FAIL: e1 should be 'TypeError: 'undefined' is not a constructor (evaluating 'new f')' but instead is 'TypeError: undefined is not a constructor (evaluating 'new f')'.
</span><del>-FAIL: e2 should be 'TypeError: 'undefined' is not a function (evaluating 'g()')' but instead is 'TypeError: undefined is not a function (evaluating 'g()')'.
</del><ins>+FAIL: e2 should be 'TypeError: 'undefined' is not a function (evaluating 'g()')' but instead is 'TypeError: g is not a function. (In 'g()', 'g' is undefined)'.
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsjsexceptionfornonobjectexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/exception-for-nonobject-expected.txt (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/exception-for-nonobject-expected.txt        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/LayoutTests/js/exception-for-nonobject-expected.txt        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -4,7 +4,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> PASS new {}.undefined threw exception TypeError: undefined is not a constructor (evaluating 'new {}.undefined').
</span><del>-PASS 1 instanceof {}.undefined threw exception TypeError: undefined is not a valid argument for 'instanceof' (evaluating '1 instanceof {}.undefined').
</del><ins>+PASS 1 instanceof {}.undefined threw exception TypeError: {}.undefined is not a function. (evaluating '1 instanceof {}.undefined').
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsjsexceptionfunctionapplyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/exception-function-apply-expected.txt (0 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/exception-function-apply-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/exception-function-apply-expected.txt        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+Test for error messages on function.apply
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS function foo(){}; foo.apply(null, 20) threw exception TypeError: second argument to Function.prototype.apply must be an Array-like object (evaluating 'foo.apply(null, 20)').
+PASS function foo(){}; foo.apply(null, 'hello') threw exception TypeError: second argument to Function.prototype.apply must be an Array-like object (evaluating 'foo.apply(null, 'hello')').
+PASS function foo(){}; foo.apply(null, true) threw exception TypeError: second argument to Function.prototype.apply must be an Array-like object (evaluating 'foo.apply(null, true)').
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsexceptionfunctionapplyhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/exception-function-apply.html (0 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/exception-function-apply.html                                (rev 0)
+++ trunk/LayoutTests/js/exception-function-apply.html        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;script-tests/exception-function-apply.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsjsexceptioninexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/exception-in-expected.txt (0 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/exception-in-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/exception-in-expected.txt        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+Test for error messages for in
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS 20   in   'in in in'   threw exception TypeError: &quot;in in in&quot; is not an Object. (evaluating '20   in   'in in in'').
+PASS 20   in   true   threw exception TypeError: true is not an Object. (evaluating '20   in   true').
+PASS 20   in   {}.foo   threw exception TypeError: {}.foo is not an Object. (evaluating '20   in   {}.foo').
+PASS 20   in   20   threw exception TypeError: 20 is not an Object. (evaluating '20   in   20').
+PASS 20   in   null   threw exception TypeError: null is not an Object. (evaluating '20   in   null').
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsexceptioninhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/exception-in.html (0 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/exception-in.html                                (rev 0)
+++ trunk/LayoutTests/js/exception-in.html        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;script-tests/exception-in.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsjsexceptioninstanceofexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/exception-instanceof-expected.txt (0 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/exception-instanceof-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/exception-instanceof-expected.txt        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+Test for error messages for instanceof
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS 'instanceof' instanceof    'instanceof' threw exception TypeError: &quot;instanceof&quot; is not a function. (evaluating ''instanceof' instanceof    'instanceof'').
+PASS 20 instanceof     'hello'   threw exception TypeError: 'hello' is not a function. (evaluating '20 instanceof     'hello'').
+PASS 20 instanceof     {}   threw exception TypeError: {} is not a function. (evaluating '20 instanceof     {}').
+PASS 20 instanceof     {}.foo  threw exception TypeError: {}.foo is not a function. (evaluating '20 instanceof     {}.foo').
+PASS 20 instanceof     true       threw exception TypeError: true is not a function. (evaluating '20 instanceof     true').
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsexceptioninstanceofhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/exception-instanceof.html (0 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/exception-instanceof.html                                (rev 0)
+++ trunk/LayoutTests/js/exception-instanceof.html        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;script-tests/exception-instanceof.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsjsinstanceofimmediatesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/instance-of-immediates-expected.txt (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/instance-of-immediates-expected.txt        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/LayoutTests/js/instance-of-immediates-expected.txt        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -3,12 +3,12 @@
</span><span class="cx"> On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-PASS (1 instanceof 1) threw exception TypeError: 1 is not a valid argument for 'instanceof' (evaluating '1 instanceof 1').
-PASS ({} instanceof 1) threw exception TypeError: 1 is not a valid argument for 'instanceof' (evaluating '{} instanceof 1').
-PASS (obj instanceof 1) threw exception TypeError: 1 is not a valid argument for 'instanceof' (evaluating 'obj instanceof 1').
-PASS (1 instanceof {}) threw exception TypeError: Object is not a valid argument for 'instanceof' (evaluating '1 instanceof {}').
-PASS ({} instanceof {}) threw exception TypeError: Object is not a valid argument for 'instanceof' (evaluating '{} instanceof {}').
-PASS (obj instanceof {}) threw exception TypeError: Object is not a valid argument for 'instanceof' (evaluating 'obj instanceof {}').
</del><ins>+PASS (1 instanceof 1) threw exception TypeError: 1 is not a function. (evaluating '1 instanceof 1').
+PASS ({} instanceof 1) threw exception TypeError: 1 is not a function. (evaluating '{} instanceof 1').
+PASS (obj instanceof 1) threw exception TypeError: 1 is not a function. (evaluating 'obj instanceof 1').
+PASS (1 instanceof {}) threw exception TypeError: {} is not a function. (evaluating '1 instanceof {}').
+PASS ({} instanceof {}) threw exception TypeError: {} is not a function. (evaluating '{} instanceof {}').
+PASS (obj instanceof {}) threw exception TypeError: {} is not a function. (evaluating 'obj instanceof {}').
</ins><span class="cx"> PASS (1 instanceof Constructor) is false
</span><span class="cx"> PASS ({} instanceof Constructor) is false
</span><span class="cx"> PASS (obj instanceof Constructor) is true
</span></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsexceptionfunctionapplyjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/exception-function-apply.js (0 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/exception-function-apply.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/exception-function-apply.js        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+description(&quot;Test for error messages on function.apply&quot;);
+
+shouldThrow(&quot;function foo(){}; foo.apply(null, 20)&quot;);
+shouldThrow(&quot;function foo(){}; foo.apply(null, 'hello')&quot;);
+shouldThrow(&quot;function foo(){}; foo.apply(null, true)&quot;);
</ins></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsexceptioninjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/exception-in.js (0 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/exception-in.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/exception-in.js        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+description(&quot;Test for error messages for in&quot;);
+
+shouldThrow(&quot;20   in   'in in in'  &quot;);
+shouldThrow(&quot;20   in   true  &quot;);
+shouldThrow(&quot;20   in   {}.foo  &quot;);
+shouldThrow(&quot;20   in   20  &quot;);
+shouldThrow(&quot;20   in   null  &quot;);
</ins></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsexceptioninstanceofjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/exception-instanceof.js (0 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/exception-instanceof.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/exception-instanceof.js        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+description(&quot;Test for error messages for instanceof&quot;);
+
+shouldThrow(&quot;'instanceof' instanceof    'instanceof'&quot;);
+shouldThrow(&quot;20 instanceof     'hello'  &quot;);
+shouldThrow(&quot;20 instanceof     {}  &quot;);
+shouldThrow(&quot;20 instanceof     {}.foo &quot;);
+shouldThrow(&quot;20 instanceof     true      &quot;);
</ins></span></pre></div>
<a id="trunkLayoutTestsjstypedarrayconstructorsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/typedarray-constructors-expected.txt (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/typedarray-constructors-expected.txt        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/LayoutTests/js/typedarray-constructors-expected.txt        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -3,25 +3,25 @@
</span><span class="cx"> On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-PASS Int8Array() threw exception TypeError: Function is not a function (evaluating 'Int8Array()').
</del><ins>+PASS Int8Array() threw exception TypeError: Int8Array is not a function. (In 'Int8Array()', 'Int8Array' is an instance of Function).
</ins><span class="cx"> PASS new Int8Array() did not throw exception.
</span><del>-PASS Int16Array() threw exception TypeError: Function is not a function (evaluating 'Int16Array()').
</del><ins>+PASS Int16Array() threw exception TypeError: Int16Array is not a function. (In 'Int16Array()', 'Int16Array' is an instance of Function).
</ins><span class="cx"> PASS new Int16Array() did not throw exception.
</span><del>-PASS Int32Array() threw exception TypeError: Function is not a function (evaluating 'Int32Array()').
</del><ins>+PASS Int32Array() threw exception TypeError: Int32Array is not a function. (In 'Int32Array()', 'Int32Array' is an instance of Function).
</ins><span class="cx"> PASS new Int32Array() did not throw exception.
</span><del>-PASS Uint8Array() threw exception TypeError: Function is not a function (evaluating 'Uint8Array()').
</del><ins>+PASS Uint8Array() threw exception TypeError: Uint8Array is not a function. (In 'Uint8Array()', 'Uint8Array' is an instance of Function).
</ins><span class="cx"> PASS new Uint8Array() did not throw exception.
</span><del>-PASS Uint16Array() threw exception TypeError: Function is not a function (evaluating 'Uint16Array()').
</del><ins>+PASS Uint16Array() threw exception TypeError: Uint16Array is not a function. (In 'Uint16Array()', 'Uint16Array' is an instance of Function).
</ins><span class="cx"> PASS new Uint16Array() did not throw exception.
</span><del>-PASS Uint32Array() threw exception TypeError: Function is not a function (evaluating 'Uint32Array()').
</del><ins>+PASS Uint32Array() threw exception TypeError: Uint32Array is not a function. (In 'Uint32Array()', 'Uint32Array' is an instance of Function).
</ins><span class="cx"> PASS new Uint32Array() did not throw exception.
</span><del>-PASS Uint8ClampedArray() threw exception TypeError: Function is not a function (evaluating 'Uint8ClampedArray()').
</del><ins>+PASS Uint8ClampedArray() threw exception TypeError: Uint8ClampedArray is not a function. (In 'Uint8ClampedArray()', 'Uint8ClampedArray' is an instance of Function).
</ins><span class="cx"> PASS new Uint8ClampedArray() did not throw exception.
</span><del>-PASS Float32Array() threw exception TypeError: Function is not a function (evaluating 'Float32Array()').
</del><ins>+PASS Float32Array() threw exception TypeError: Float32Array is not a function. (In 'Float32Array()', 'Float32Array' is an instance of Function).
</ins><span class="cx"> PASS new Float32Array() did not throw exception.
</span><del>-PASS Float64Array() threw exception TypeError: Function is not a function (evaluating 'Float64Array()').
</del><ins>+PASS Float64Array() threw exception TypeError: Float64Array is not a function. (In 'Float64Array()', 'Float64Array' is an instance of Function).
</ins><span class="cx"> PASS new Float64Array() did not throw exception.
</span><del>-PASS DataView(new ArrayBuffer()) threw exception TypeError: Function is not a function (evaluating 'DataView(new ArrayBuffer())').
</del><ins>+PASS DataView(new ArrayBuffer()) threw exception TypeError: DataView is not a function. (In 'DataView(new ArrayBuffer())', 'DataView' is an instance of Function).
</ins><span class="cx"> PASS new DataView(new ArrayBuffer()) did not throw exception.
</span><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss3selectors3xhtmlcss3modsel15cexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/css3/selectors3/xhtml/css3-modsel-15c-expected.txt (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/css3/selectors3/xhtml/css3-modsel-15c-expected.txt        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/LayoutTests/platform/mac/css3/selectors3/xhtml/css3-modsel-15c-expected.txt        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-CONSOLE MESSAGE: line 27: TypeError: undefined is not a function (evaluating 'document.getElementsByTagNameNS('http://www.w3.org/1999/xhtml', 'div')[0].setIdAttribute('title', true)')
</del><ins>+CONSOLE MESSAGE: line 27: TypeError: document.getElementsByTagNameNS('http://www.w3.org/1999/xhtml', 'div')[0].setIdAttribute is not a function. (In 'document.getElementsByTagNameNS('http://www.w3.org/1999/xhtml', 'div')[0].setIdAttribute('title', true)', 'document.getElementsByTagNameNS('http://www.w3.org/1999/xhtml', 'div')[0].setIdAttribute' is undefined)
</ins><span class="cx"> layer at (0,0) size 800x600
</span><span class="cx">   RenderView at (0,0) size 800x600
</span><span class="cx"> layer at (0,0) size 800x186
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss3selectors3xmlcss3modsel15cexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/css3/selectors3/xml/css3-modsel-15c-expected.txt (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/css3/selectors3/xml/css3-modsel-15c-expected.txt        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/LayoutTests/platform/mac/css3/selectors3/xml/css3-modsel-15c-expected.txt        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-CONSOLE MESSAGE: line 9: TypeError: undefined is not a function (evaluating 'document.getElementsByTagNameNS('http://www.w3.org/1999/xhtml', 'div')[0].setIdAttribute('title', true)')
</del><ins>+CONSOLE MESSAGE: line 9: TypeError: document.getElementsByTagNameNS('http://www.w3.org/1999/xhtml', 'div')[0].setIdAttribute is not a function. (In 'document.getElementsByTagNameNS('http://www.w3.org/1999/xhtml', 'div')[0].setIdAttribute('title', true)', 'document.getElementsByTagNameNS('http://www.w3.org/1999/xhtml', 'div')[0].setIdAttribute' is undefined)
</ins><span class="cx"> layer at (0,0) size 800x600
</span><span class="cx">   RenderView at (0,0) size 800x600
</span><span class="cx"> layer at (0,0) size 800x186
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2pluginsnpruntimeobjectfromdestroyedpluginexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk2/plugins/npruntime/object-from-destroyed-plugin-expected.txt (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/plugins/npruntime/object-from-destroyed-plugin-expected.txt        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/LayoutTests/platform/mac-wk2/plugins/npruntime/object-from-destroyed-plugin-expected.txt        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -5,6 +5,6 @@
</span><span class="cx"> 
</span><span class="cx"> PASS testObject.gettingProperty threw exception ReferenceError: Trying to access object from destroyed plug-in..
</span><span class="cx"> PASS testObject.settingProperty = 10 threw exception ReferenceError: Trying to access object from destroyed plug-in..
</span><del>-PASS testObject() threw exception TypeError: NPObject is not a function (evaluating 'testObject()').
</del><ins>+PASS testObject() threw exception TypeError: testObject is not a function. (In 'testObject()', 'testObject' is an instance of NPObject).
</ins><span class="cx"> PASS new testObject(); threw exception TypeError: NPObject is not a constructor (evaluating 'new testObject()').
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2pluginsnpruntimeobjectfromdestroyedplugininsubframeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk2/plugins/npruntime/object-from-destroyed-plugin-in-subframe-expected.txt (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/plugins/npruntime/object-from-destroyed-plugin-in-subframe-expected.txt        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/LayoutTests/platform/mac-wk2/plugins/npruntime/object-from-destroyed-plugin-in-subframe-expected.txt        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -5,6 +5,6 @@
</span><span class="cx"> 
</span><span class="cx">  PASS testObject.gettingProperty threw exception ReferenceError: Trying to access object from destroyed plug-in..
</span><span class="cx"> PASS testObject.settingProperty = 10 threw exception ReferenceError: Trying to access object from destroyed plug-in..
</span><del>-PASS testObject() threw exception TypeError: NPObject is not a function (evaluating 'testObject()').
</del><ins>+PASS testObject() threw exception TypeError: testObject is not a function. (In 'testObject()', 'testObject' is an instance of NPObject).
</ins><span class="cx"> PASS new testObject(); threw exception TypeError: NPObject is not a constructor (evaluating 'new testObject()').
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestspluginsnpruntimeobjectfromdestroyedpluginexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/plugins/npruntime/object-from-destroyed-plugin-expected.txt (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/plugins/npruntime/object-from-destroyed-plugin-expected.txt        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/LayoutTests/plugins/npruntime/object-from-destroyed-plugin-expected.txt        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -5,6 +5,6 @@
</span><span class="cx"> 
</span><span class="cx"> PASS testObject.gettingProperty threw exception ReferenceError: Trying to access object from destroyed plug-in..
</span><span class="cx"> PASS testObject.settingProperty = 10 threw exception ReferenceError: Trying to access object from destroyed plug-in..
</span><del>-PASS testObject() threw exception TypeError: ProxyRuntimeObject is not a function (evaluating 'testObject()').
</del><ins>+PASS testObject() threw exception TypeError: testObject is not a function. (In 'testObject()', 'testObject' is an instance of ProxyRuntimeObject).
</ins><span class="cx"> PASS new testObject(); threw exception TypeError: ProxyRuntimeObject is not a constructor (evaluating 'new testObject()').
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestspluginsnpruntimeobjectfromdestroyedplugininsubframeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/plugins/npruntime/object-from-destroyed-plugin-in-subframe-expected.txt (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/plugins/npruntime/object-from-destroyed-plugin-in-subframe-expected.txt        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/LayoutTests/plugins/npruntime/object-from-destroyed-plugin-in-subframe-expected.txt        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -5,6 +5,6 @@
</span><span class="cx"> 
</span><span class="cx">  PASS testObject.gettingProperty threw exception ReferenceError: Trying to access object from destroyed plug-in..
</span><span class="cx"> PASS testObject.settingProperty = 10 threw exception ReferenceError: Trying to access object from destroyed plug-in..
</span><del>-PASS testObject() threw exception TypeError: ProxyRuntimeObject is not a function (evaluating 'testObject()').
</del><ins>+PASS testObject() threw exception TypeError: testObject is not a function. (In 'testObject()', 'testObject' is an instance of ProxyRuntimeObject).
</ins><span class="cx"> PASS new testObject(); threw exception TypeError: ProxyRuntimeObject is not a constructor (evaluating 'new testObject()').
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestspluginsnpruntimepluginscriptableobjectinvokedefaultexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/plugins/npruntime/plugin-scriptable-object-invoke-default-expected.txt (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/plugins/npruntime/plugin-scriptable-object-invoke-default-expected.txt        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/LayoutTests/plugins/npruntime/plugin-scriptable-object-invoke-default-expected.txt        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -7,5 +7,5 @@
</span><span class="cx"> PASS typeof(pluginWithInvokeDefault) is 'function'
</span><span class="cx"> PASS pluginWithInvokeDefault() is 1
</span><span class="cx"> PASS typeof(pluginWithoutInvokeDefault) is 'object'
</span><del>-PASS pluginWithoutInvokeDefault() threw exception TypeError: HTMLEmbedElement is not a function (evaluating 'pluginWithoutInvokeDefault()').
</del><ins>+PASS pluginWithoutInvokeDefault() threw exception TypeError: pluginWithoutInvokeDefault is not a function. (In 'pluginWithoutInvokeDefault()', 'pluginWithoutInvokeDefault' is an instance of HTMLEmbedElement).
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestssputnikConformance12_Statement121_BlockS121_A4_T1expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/sputnik/Conformance/12_Statement/12.1_Block/S12.1_A4_T1-expected.txt (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/sputnik/Conformance/12_Statement/12.1_Block/S12.1_A4_T1-expected.txt        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/LayoutTests/sputnik/Conformance/12_Statement/12.1_Block/S12.1_A4_T1-expected.txt        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> S12.1_A4_T1
</span><span class="cx"> 
</span><del>-PASS TypeError: Object is not a function (evaluating '{__func}()')
</del><ins>+PASS TypeError: {__func} is not a function. (In '{__func}()', '{__func}' is an instance of Object)
</ins><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestssputnikConformance13_Function_DefinitionS13_A17_T2expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/sputnik/Conformance/13_Function_Definition/S13_A17_T2-expected.txt (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/sputnik/Conformance/13_Function_Definition/S13_A17_T2-expected.txt        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/LayoutTests/sputnik/Conformance/13_Function_Definition/S13_A17_T2-expected.txt        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> S13_A17_T2
</span><span class="cx"> 
</span><del>-TypeError: undefined is not a function (evaluating '__func()')
</del><ins>+TypeError: __func is not a function. (In '__func()', '__func' is undefined)
</ins><span class="cx"> PASS 
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestssputnikConformance15_Native_Objects151_The_Global_ObjectS151_A2_T1expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object/S15.1_A2_T1-expected.txt (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object/S15.1_A2_T1-expected.txt        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object/S15.1_A2_T1-expected.txt        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> S15.1_A2_T1
</span><span class="cx"> 
</span><del>-PASS TypeError: Window is not a function (evaluating 'this()')
</del><ins>+PASS TypeError: this is not a function. (In 'this()', 'this' is an instance of Window)
</ins><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestssputnikConformance15_Native_Objects152_Object1524S1524_A3expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.2_Object/15.2.4/S15.2.4_A3-expected.txt (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.2_Object/15.2.4/S15.2.4_A3-expected.txt        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/LayoutTests/sputnik/Conformance/15_Native_Objects/15.2_Object/15.2.4/S15.2.4_A3-expected.txt        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> S15.2.4_A3
</span><span class="cx"> 
</span><del>-TypeError: Object is not a function (evaluating 'Object.prototype()')
</del><ins>+TypeError: Object.prototype is not a function. (In 'Object.prototype()', 'Object.prototype' is an instance of Object)
</ins><span class="cx"> PASS 
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestssvgdomsvgpathoutofboundsgetPathSegexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/dom/svgpath-out-of-bounds-getPathSeg-expected.txt (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/dom/svgpath-out-of-bounds-getPathSeg-expected.txt        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/LayoutTests/svg/dom/svgpath-out-of-bounds-getPathSeg-expected.txt        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -5,14 +5,14 @@
</span><span class="cx"> 
</span><span class="cx"> PASS path.pathSegList.initialize(); threw exception TypeError: Not enough arguments.
</span><span class="cx"> PASS path.getPathSegAtLength(0) is 0
</span><del>-PASS path.insertItemBefore(null, 0) threw exception TypeError: undefined is not a function (evaluating 'path.insertItemBefore(null, 0)').
-PASS path.replaceItem(null, 0) threw exception TypeError: undefined is not a function (evaluating 'path.replaceItem(null, 0)').
-PASS path.appendItem(null) threw exception TypeError: undefined is not a function (evaluating 'path.appendItem(null)').
</del><ins>+PASS path.insertItemBefore(null, 0) threw exception TypeError: path.insertItemBefore is not a function. (In 'path.insertItemBefore(null, 0)', 'path.insertItemBefore' is undefined).
+PASS path.replaceItem(null, 0) threw exception TypeError: path.replaceItem is not a function. (In 'path.replaceItem(null, 0)', 'path.replaceItem' is undefined).
+PASS path.appendItem(null) threw exception TypeError: path.appendItem is not a function. (In 'path.appendItem(null)', 'path.appendItem' is undefined).
</ins><span class="cx"> List correctly initialised.
</span><span class="cx"> PASS path.getPathSegAtLength(0) is 0
</span><del>-PASS path.insertItemBefore(null, 0) threw exception TypeError: undefined is not a function (evaluating 'path.insertItemBefore(null, 0)').
-PASS path.replaceItem(null, 0) threw exception TypeError: undefined is not a function (evaluating 'path.replaceItem(null, 0)').
-PASS path.appendItem(null) threw exception TypeError: undefined is not a function (evaluating 'path.appendItem(null)').
</del><ins>+PASS path.insertItemBefore(null, 0) threw exception TypeError: path.insertItemBefore is not a function. (In 'path.insertItemBefore(null, 0)', 'path.insertItemBefore' is undefined).
+PASS path.replaceItem(null, 0) threw exception TypeError: path.replaceItem is not a function. (In 'path.replaceItem(null, 0)', 'path.replaceItem' is undefined).
+PASS path.appendItem(null) threw exception TypeError: path.appendItem is not a function. (In 'path.appendItem(null)', 'path.appendItem' is undefined).
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/CMakeLists.txt (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -535,6 +535,7 @@
</span><span class="cx">     runtime/RegExpMatchesArray.cpp
</span><span class="cx">     runtime/RegExpObject.cpp
</span><span class="cx">     runtime/RegExpPrototype.cpp
</span><ins>+    runtime/RuntimeType.cpp
</ins><span class="cx">     runtime/SamplingCounter.cpp
</span><span class="cx">     runtime/SetConstructor.cpp
</span><span class="cx">     runtime/SetIteratorConstructor.cpp
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -1,3 +1,80 @@
</span><ins>+2015-03-24  Saam Barati  &lt;saambarati1@gmail.com&gt;
+
+        Improve error messages in JSC
+        https://bugs.webkit.org/show_bug.cgi?id=141869
+
+        Reviewed by Geoffrey Garen.
+
+        JavaScriptCore has some unintuitive error messages associated
+        with certain common errors. This patch changes some specific
+        error messages to be more understandable and also creates a
+        mechanism that will allow for easy modification of error messages
+        in the future. The specific errors we change are not a function
+        errors and invalid parameter errors.
+
+        * CMakeLists.txt:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * interpreter/Interpreter.cpp:
+        (JSC::sizeOfVarargs):
+        * jit/JITOperations.cpp:
+        op_throw_static_error always has a JSString as its argument.
+        There is no need to dance around this, and we should assert
+        that this always holds. This JSString represents the error 
+        message we want to display to the user, so there is no need
+        to pass it into errorDescriptionForValue which will now place
+        quotes around the string.
+
+        * llint/LLIntSlowPaths.cpp:
+        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+        * runtime/CommonSlowPaths.h:
+        (JSC::CommonSlowPaths::opIn):
+        * runtime/ErrorInstance.cpp:
+        (JSC::ErrorInstance::ErrorInstance):
+        * runtime/ErrorInstance.h:
+        (JSC::ErrorInstance::hasSourceAppender):
+        (JSC::ErrorInstance::sourceAppender):
+        (JSC::ErrorInstance::setSourceAppender):
+        (JSC::ErrorInstance::clearSourceAppender):
+        (JSC::ErrorInstance::setRuntimeTypeForCause):
+        (JSC::ErrorInstance::runtimeTypeForCause):
+        (JSC::ErrorInstance::clearRuntimeTypeForCause):
+        (JSC::ErrorInstance::appendSourceToMessage): Deleted.
+        (JSC::ErrorInstance::setAppendSourceToMessage): Deleted.
+        (JSC::ErrorInstance::clearAppendSourceToMessage): Deleted.
+        * runtime/ExceptionHelpers.cpp:
+        (JSC::errorDescriptionForValue):
+        (JSC::defaultApproximateSourceError):
+        (JSC::defaultSourceAppender):
+        (JSC::functionCallBase):
+        (JSC::notAFunctionSourceAppender):
+        (JSC::invalidParameterInSourceAppender):
+        (JSC::invalidParameterInstanceofSourceAppender):
+        (JSC::createError):
+        (JSC::createInvalidFunctionApplyParameterError):
+        (JSC::createInvalidInParameterError):
+        (JSC::createInvalidInstanceofParameterError):
+        (JSC::createNotAConstructorError):
+        (JSC::createNotAFunctionError):
+        (JSC::createNotAnObjectError):
+        (JSC::createInvalidParameterError): Deleted.
+        * runtime/ExceptionHelpers.h:
+        * runtime/JSObject.cpp:
+        (JSC::JSObject::hasInstance):
+        * runtime/RuntimeType.cpp: Added.
+        (JSC::runtimeTypeForValue):
+        (JSC::runtimeTypeAsString):
+        * runtime/RuntimeType.h: Added.
+        * runtime/TypeProfilerLog.cpp:
+        (JSC::TypeProfilerLog::processLogEntries):
+        * runtime/TypeSet.cpp:
+        (JSC::TypeSet::getRuntimeTypeForValue): Deleted.
+        * runtime/TypeSet.h:
+        * runtime/VM.cpp:
+        (JSC::appendSourceToError):
+        (JSC::VM::throwException):
+
</ins><span class="cx"> 2015-03-23  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         JSC should have a low-cost asynchronous disassembler
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -802,6 +802,7 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\RegExpMatchesArray.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\RegExpObject.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\RegExpPrototype.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\runtime\RuntimeType.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\SamplingCounter.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\SetConstructor.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\SetIteratorConstructor.cpp&quot; /&gt;
</span><span class="lines">@@ -1614,6 +1615,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\RegExpPrototype.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\Reject.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\RuntimeFlags.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\runtime\RuntimeType.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\SamplingCounter.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\SetConstructor.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\SetIteratorConstructor.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -801,6 +801,9 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\RegExpPrototype.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;runtime&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\runtime\RuntimeType.cpp&quot;&gt;
+      &lt;Filter&gt;runtime&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\runtime\SamplingCounter.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;runtime&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -2870,6 +2873,9 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\RuntimeFlags.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;runtime&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\runtime\RuntimeType.h&quot;&gt;
+      &lt;Filter&gt;runtime&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\runtime\SamplingCounter.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;runtime&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -910,11 +910,13 @@
</span><span class="cx">                 52678F8E1A031009006A306D /* BasicBlockLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52678F8C1A031009006A306D /* BasicBlockLocation.cpp */; };
</span><span class="cx">                 52678F8F1A031009006A306D /* BasicBlockLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 52678F8D1A031009006A306D /* BasicBlockLocation.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 52678F911A04177C006A306D /* ControlFlowProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 52678F901A04177C006A306D /* ControlFlowProfiler.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                527773DE1AAF83AC00BDE7E8 /* RuntimeType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 527773DD1AAF83AC00BDE7E8 /* RuntimeType.cpp */; };
</ins><span class="cx">                 52B310FB1974AE610080857C /* FunctionHasExecutedCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 52B310FA1974AE610080857C /* FunctionHasExecutedCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 52B310FD1974AE870080857C /* FunctionHasExecutedCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52B310FC1974AE870080857C /* FunctionHasExecutedCache.cpp */; };
</span><span class="cx">                 52B310FF1975B4240080857C /* TypeLocationCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52B310FE1975B4240080857C /* TypeLocationCache.cpp */; };
</span><span class="cx">                 52B311011975B4670080857C /* TypeLocationCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 52B311001975B4670080857C /* TypeLocationCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 52B717B51A0597E1007AF4F3 /* ControlFlowProfiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52B717B41A0597E1007AF4F3 /* ControlFlowProfiler.cpp */; };
</span><ins>+                52C0611F1AA51E1C00B4ADBA /* RuntimeType.h in Headers */ = {isa = PBXBuildFile; fileRef = 52C0611D1AA51E1B00B4ADBA /* RuntimeType.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 52C952B719A289850069B386 /* TypeProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 52C952B619A289850069B386 /* TypeProfiler.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 52C952B919A28A1C0069B386 /* TypeProfiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52C952B819A28A1C0069B386 /* TypeProfiler.cpp */; };
</span><span class="cx">                 5D53726F0E1C54880021E549 /* Tracing.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D53726E0E1C54880021E549 /* Tracing.h */; };
</span><span class="lines">@@ -2567,11 +2569,13 @@
</span><span class="cx">                 52678F8C1A031009006A306D /* BasicBlockLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BasicBlockLocation.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 52678F8D1A031009006A306D /* BasicBlockLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BasicBlockLocation.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 52678F901A04177C006A306D /* ControlFlowProfiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ControlFlowProfiler.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                527773DD1AAF83AC00BDE7E8 /* RuntimeType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RuntimeType.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 52B310FA1974AE610080857C /* FunctionHasExecutedCache.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FunctionHasExecutedCache.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 52B310FC1974AE870080857C /* FunctionHasExecutedCache.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FunctionHasExecutedCache.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 52B310FE1975B4240080857C /* TypeLocationCache.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TypeLocationCache.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 52B311001975B4670080857C /* TypeLocationCache.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TypeLocationCache.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 52B717B41A0597E1007AF4F3 /* ControlFlowProfiler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ControlFlowProfiler.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                52C0611D1AA51E1B00B4ADBA /* RuntimeType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RuntimeType.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 52C952B619A289850069B386 /* TypeProfiler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TypeProfiler.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 52C952B819A28A1C0069B386 /* TypeProfiler.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TypeProfiler.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5540758418F4A37500602A5D /* CompileRuntimeToLLVMIR.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = CompileRuntimeToLLVMIR.xcconfig; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4564,6 +4568,8 @@
</span><span class="cx">                                 0F6B1CB81861244C00845D97 /* RegisterPreservationMode.h */,
</span><span class="cx">                                 0FB7F39115ED8E3800F167B2 /* Reject.h */,
</span><span class="cx">                                 70B0A9D01A9B66200001306A /* RuntimeFlags.h */,
</span><ins>+                                527773DD1AAF83AC00BDE7E8 /* RuntimeType.cpp */,
+                                52C0611D1AA51E1B00B4ADBA /* RuntimeType.h */,
</ins><span class="cx">                                 0F7700911402FF280078EB39 /* SamplingCounter.cpp */,
</span><span class="cx">                                 0F77008E1402FDD60078EB39 /* SamplingCounter.h */,
</span><span class="cx">                                 A7299DA317D12858005F5FF9 /* SetConstructor.cpp */,
</span><span class="lines">@@ -5459,6 +5465,7 @@
</span><span class="cx">                                 0F6B1CB91861244C00845D97 /* ArityCheckMode.h in Headers */,
</span><span class="cx">                                 A1A009C11831A26E00CF8711 /* ARM64Assembler.h in Headers */,
</span><span class="cx">                                 86D3B2C410156BDE002865E7 /* ARMAssembler.h in Headers */,
</span><ins>+                                52C0611F1AA51E1C00B4ADBA /* RuntimeType.h in Headers */,
</ins><span class="cx">                                 C442CB251A6CDB8C005D3D7C /* JSInputs.json in Headers */,
</span><span class="cx">                                 52678F911A04177C006A306D /* ControlFlowProfiler.h in Headers */,
</span><span class="cx">                                 52678F8F1A031009006A306D /* BasicBlockLocation.h in Headers */,
</span><span class="lines">@@ -7096,6 +7103,7 @@
</span><span class="cx">                                 C25F8BCD157544A900245B71 /* IncrementalSweeper.cpp in Sources */,
</span><span class="cx">                                 0F13E04E16164A1F00DC8DE7 /* IndexingType.cpp in Sources */,
</span><span class="cx">                                 0FCEFACA1805E75500472CE4 /* InitializeLLVM.cpp in Sources */,
</span><ins>+                                527773DE1AAF83AC00BDE7E8 /* RuntimeType.cpp in Sources */,
</ins><span class="cx">                                 A513E5B7185B8BD3007E95AD /* InjectedScript.cpp in Sources */,
</span><span class="cx">                                 0FBF158C19B7A53100695DD0 /* DFGBlockSet.cpp in Sources */,
</span><span class="cx">                                 A514B2C2185A684400F3C7CB /* InjectedScriptBase.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterInterpretercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -142,7 +142,7 @@
</span><span class="cx">     else if (arguments.isUndefinedOrNull())
</span><span class="cx">         length = 0;
</span><span class="cx">     else if (!arguments.isObject()) {
</span><del>-        callFrame-&gt;vm().throwException(callFrame, createInvalidParameterError(callFrame, &quot;Function.prototype.apply&quot;, arguments));
</del><ins>+        callFrame-&gt;vm().throwException(callFrame, createInvalidFunctionApplyParameterError(callFrame,  arguments));
</ins><span class="cx">         return 0;
</span><span class="cx">     } else if (asObject(arguments)-&gt;classInfo() == Arguments::info())
</span><span class="cx">         length = asArguments(arguments)-&gt;length(callFrame);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOperations.cpp (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -200,7 +200,7 @@
</span><span class="cx">     NativeCallFrameTracer tracer(vm, exec);
</span><span class="cx">     
</span><span class="cx">     if (!base-&gt;isObject()) {
</span><del>-        vm-&gt;throwException(exec, createInvalidParameterError(exec, &quot;in&quot;, base));
</del><ins>+        vm-&gt;throwException(exec, createInvalidInParameterError(exec, base));
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -226,7 +226,7 @@
</span><span class="cx">     NativeCallFrameTracer tracer(vm, exec);
</span><span class="cx"> 
</span><span class="cx">     if (!base-&gt;isObject()) {
</span><del>-        vm-&gt;throwException(exec, createInvalidParameterError(exec, &quot;in&quot;, base));
</del><ins>+        vm-&gt;throwException(exec, createInvalidInParameterError(exec, base));
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -966,12 +966,13 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(&amp;vm, exec);
</span><del>-
-    String message = errorDescriptionForValue(exec, JSValue::decode(encodedValue))-&gt;value(exec);
</del><ins>+    JSValue errorMessageValue = JSValue::decode(encodedValue);
+    RELEASE_ASSERT(errorMessageValue.isString());
+    String errorMessage = asString(errorMessageValue)-&gt;value(exec);
</ins><span class="cx">     if (referenceErrorFlag)
</span><del>-        vm.throwException(exec, createReferenceError(exec, message));
</del><ins>+        vm.throwException(exec, createReferenceError(exec, errorMessage));
</ins><span class="cx">     else
</span><del>-        vm.throwException(exec, createTypeError(exec, message));
</del><ins>+        vm.throwException(exec, createTypeError(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">@@ -1348,7 +1349,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    vm.throwException(exec, createInvalidParameterError(exec, &quot;instanceof&quot;, baseVal));
</del><ins>+    vm.throwException(exec, createInvalidInstanceofParameterError(exec, baseVal));
</ins><span class="cx">     return JSValue::encode(JSValue());
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntSlowPathscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -558,7 +558,7 @@
</span><span class="cx">             LLINT_RETURN_WITH_PC_ADJUSTMENT(result, pc[4].u.operand);
</span><span class="cx">         }
</span><span class="cx">     }
</span><del>-    LLINT_THROW(createInvalidParameterError(exec, &quot;instanceof&quot;, baseVal));
</del><ins>+    LLINT_THROW(createInvalidInstanceofParameterError(exec, baseVal));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> LLINT_SLOW_PATH_DECL(slow_path_instanceof)
</span><span class="lines">@@ -1305,10 +1305,13 @@
</span><span class="cx"> LLINT_SLOW_PATH_DECL(slow_path_throw_static_error)
</span><span class="cx"> {
</span><span class="cx">     LLINT_BEGIN();
</span><ins>+    JSValue errorMessageValue = LLINT_OP_C(1).jsValue();
+    RELEASE_ASSERT(errorMessageValue.isString());
+    String errorMessage = asString(errorMessageValue)-&gt;value(exec);
</ins><span class="cx">     if (pc[2].u.operand)
</span><del>-        LLINT_THROW(createReferenceError(exec, errorDescriptionForValue(exec, LLINT_OP_C(1).jsValue())-&gt;value(exec)));
</del><ins>+        LLINT_THROW(createReferenceError(exec, errorMessage));
</ins><span class="cx">     else
</span><del>-        LLINT_THROW(createTypeError(exec, errorDescriptionForValue(exec, LLINT_OP_C(1).jsValue())-&gt;value(exec)));
</del><ins>+        LLINT_THROW(createTypeError(exec, errorMessage));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> LLINT_SLOW_PATH_DECL(slow_path_handle_watchdog_timer)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCommonSlowPathsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx"> inline bool opIn(ExecState* exec, JSValue propName, JSValue baseVal)
</span><span class="cx"> {
</span><span class="cx">     if (!baseVal.isObject()) {
</span><del>-        exec-&gt;vm().throwException(exec, createInvalidParameterError(exec, &quot;in&quot;, baseVal));
</del><ins>+        exec-&gt;vm().throwException(exec, createInvalidInParameterError(exec, baseVal));
</ins><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeErrorInstancecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ErrorInstance.cpp (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ErrorInstance.cpp        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/Source/JavaScriptCore/runtime/ErrorInstance.cpp        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx"> 
</span><span class="cx"> ErrorInstance::ErrorInstance(VM&amp; vm, Structure* structure)
</span><span class="cx">     : JSNonFinalObject(vm, structure)
</span><del>-    , m_appendSourceToMessage(false)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeErrorInstanceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ErrorInstance.h (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ErrorInstance.h        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/Source/JavaScriptCore/runtime/ErrorInstance.h        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> #define ErrorInstance_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Interpreter.h&quot;
</span><del>-#include &quot;JSObject.h&quot;
</del><ins>+#include &quot;RuntimeType.h&quot;
</ins><span class="cx"> #include &quot;SourceProvider.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="lines">@@ -50,16 +50,24 @@
</span><span class="cx">         return create(exec-&gt;vm(), structure, message.isUndefined() ? String() : message.toString(exec)-&gt;value(exec), stackTrace);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    bool appendSourceToMessage() { return m_appendSourceToMessage; }
-    void setAppendSourceToMessage() { m_appendSourceToMessage = true; }
-    void clearAppendSourceToMessage() { m_appendSourceToMessage = false; }
</del><ins>+    enum SourceTextWhereErrorOccurred { FoundExactSource, FoundApproximateSource };
+    typedef String (*SourceAppender) (const String&amp; originalMessage, const String&amp; sourceText, RuntimeType, SourceTextWhereErrorOccurred);
</ins><span class="cx"> 
</span><ins>+    bool hasSourceAppender() const { return !!m_sourceAppender; }
+    SourceAppender sourceAppender() const { return m_sourceAppender; }
+    void setSourceAppender(SourceAppender appender) { m_sourceAppender = appender; }
+    void clearSourceAppender() { m_sourceAppender = nullptr; }
+    void setRuntimeTypeForCause(RuntimeType type) { m_runtimeTypeForCause = type; }
+    RuntimeType runtimeTypeForCause() const { return m_runtimeTypeForCause; }
+    void clearRuntimeTypeForCause() { m_runtimeTypeForCause = TypeNothing; }
+
</ins><span class="cx"> protected:
</span><span class="cx">     explicit ErrorInstance(VM&amp;, Structure*);
</span><span class="cx"> 
</span><span class="cx">     void finishCreation(VM&amp;, const String&amp;, Vector&lt;StackFrame&gt; = Vector&lt;StackFrame&gt;());
</span><span class="cx"> 
</span><del>-    bool m_appendSourceToMessage;
</del><ins>+    SourceAppender m_sourceAppender { nullptr };
+    RuntimeType m_runtimeTypeForCause { TypeNothing };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeExceptionHelperscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -32,13 +32,14 @@
</span><span class="cx"> #include &quot;CodeBlock.h&quot;
</span><span class="cx"> #include &quot;CallFrame.h&quot;
</span><span class="cx"> #include &quot;ErrorHandlingScope.h&quot;
</span><del>-#include &quot;ErrorInstance.h&quot;
</del><span class="cx"> #include &quot;JSGlobalObjectFunctions.h&quot;
</span><del>-#include &quot;JSObject.h&quot;
</del><span class="cx"> #include &quot;JSNotAnObject.h&quot;
</span><span class="cx"> #include &quot;Interpreter.h&quot;
</span><span class="cx"> #include &quot;Nodes.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><ins>+#include &quot;RuntimeType.h&quot;
+#include &lt;wtf/text/StringBuilder.h&gt;
+#include &lt;wtf/text/StringView.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="lines">@@ -106,13 +107,13 @@
</span><span class="cx">     if (v.isFalse())
</span><span class="cx">         return vm.smallStrings.falseString();
</span><span class="cx">     if (v.isString())
</span><del>-        return jsCast&lt;JSString*&gt;(v.asCell());
</del><ins>+        return jsString(&amp;vm, makeString('&quot;',  asString(v)-&gt;value(exec), '&quot;'));
</ins><span class="cx">     if (v.isObject()) {
</span><span class="cx">         CallData callData;
</span><span class="cx">         JSObject* object = asObject(v);
</span><span class="cx">         if (object-&gt;methodTable()-&gt;getCallData(object, callData) != CallTypeNone)
</span><span class="cx">             return vm.smallStrings.functionString();
</span><del>-        return jsString(exec, object-&gt;methodTable()-&gt;className(object));
</del><ins>+        return jsString(exec, JSObject::calculatedClassName(object));
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     // The JSValue should never be empty, so this point in the code should never be reached.
</span><span class="lines">@@ -120,33 +121,167 @@
</span><span class="cx">     return vm.smallStrings.emptyString();
</span><span class="cx"> }
</span><span class="cx">     
</span><del>-JSObject* createError(ExecState* exec, ErrorFactory errorFactory, JSValue value, const String&amp; message)
</del><ins>+static String defaultApproximateSourceError(const String&amp; originalMessage, const String&amp; sourceText)
</ins><span class="cx"> {
</span><ins>+    return makeString(originalMessage, &quot; (near '...&quot;, sourceText, &quot;...')&quot;);
+}
+
+static String defaultSourceAppender(const String&amp; originalMessage, const String&amp; sourceText, RuntimeType, ErrorInstance::SourceTextWhereErrorOccurred occurrence)
+{
+    if (occurrence == ErrorInstance::FoundApproximateSource)
+        return defaultApproximateSourceError(originalMessage, sourceText);
+
+    ASSERT(occurrence == ErrorInstance::FoundExactSource);
+    return makeString(originalMessage, &quot; (evaluating '&quot;, sourceText, &quot;')&quot;);
+}
+
+static String functionCallBase(const String&amp; sourceText)
+{ 
+    // This function retrieves the 'foo.bar' substring from 'foo.bar(baz)'.
+    unsigned idx = sourceText.length() - 1;
+    if (sourceText[idx] != ')') {
+        // For function calls that have many new lines in between their open parenthesis
+        // and their closing parenthesis, the text range passed into the message appender 
+        // will not inlcude the text in between these parentheses, it will just be the desired
+        // text that precedes the parentheses.
+        return sourceText;
+    }
+
+    unsigned parenStack = 1;
+    bool isInMultiLineComment = false;
+    idx -= 1;
+    // Note that we're scanning text right to left instead of the more common left to right, 
+    // so syntax detection is backwards.
+    while (parenStack &gt; 0) {
+        UChar curChar = sourceText[idx];
+        if (isInMultiLineComment)  {
+            if (curChar == '*' &amp;&amp; sourceText[idx - 1] == '/') {
+                isInMultiLineComment = false;
+                idx -= 1;
+            }
+        } else if (curChar == '(')
+            parenStack -= 1;
+        else if (curChar == ')')
+            parenStack += 1;
+        else if (curChar == '/' &amp;&amp; sourceText[idx - 1] == '*') {
+            isInMultiLineComment = true;
+            idx -= 1;
+        }
+
+        idx -= 1;
+    }
+
+    return sourceText.left(idx + 1);
+}
+
+static String notAFunctionSourceAppender(const String&amp; originalMessage, const String&amp; sourceText, RuntimeType type, ErrorInstance::SourceTextWhereErrorOccurred occurrence)
+{
+    ASSERT(type != TypeFunction);
+
+    if (occurrence == ErrorInstance::FoundApproximateSource)
+        return defaultApproximateSourceError(originalMessage, sourceText);
+
+    ASSERT(occurrence == ErrorInstance::FoundExactSource);
+    auto notAFunctionIndex = originalMessage.reverseFind(&quot;is not a function&quot;);
+    RELEASE_ASSERT(notAFunctionIndex != notFound);
+    StringView displayValue;
+    if (originalMessage.is8Bit()) 
+        displayValue = StringView(originalMessage.characters8(), notAFunctionIndex - 1);
+    else
+        displayValue = StringView(originalMessage.characters16(), notAFunctionIndex - 1);
+
+    String base = functionCallBase(sourceText);
+    StringBuilder builder;
+    builder.append(base);
+    builder.appendLiteral(&quot; is not a function. (In '&quot;);
+    builder.append(sourceText);
+    builder.appendLiteral(&quot;', '&quot;);
+    builder.append(base);
+    builder.appendLiteral(&quot;' is &quot;);
+    if (type == TypeObject)
+        builder.appendLiteral(&quot;an instance of &quot;);
+    builder.append(displayValue);
+    builder.appendLiteral(&quot;)&quot;);
+
+    return builder.toString();
+}
+
+static String invalidParameterInSourceAppender(const String&amp; originalMessage, const String&amp; sourceText, RuntimeType, ErrorInstance::SourceTextWhereErrorOccurred occurrence)
+{
+    ASSERT(type != TypeObject);
+
+    if (occurrence == ErrorInstance::FoundApproximateSource)
+        return defaultApproximateSourceError(originalMessage, sourceText);
+
+    ASSERT(occurrence == ErrorInstance::FoundExactSource);
+    auto inIndex = sourceText.reverseFind(&quot;in&quot;);
+    RELEASE_ASSERT(inIndex != notFound);
+    if (sourceText.find(&quot;in&quot;) != inIndex)
+        return makeString(originalMessage, &quot; (evaluating '&quot;, sourceText, &quot;')&quot;);
+
+    static const unsigned inLength = 2;
+    String rightHandSide = sourceText.substring(inIndex + inLength).simplifyWhiteSpace();
+    return makeString(rightHandSide, &quot; is not an Object. (evaluating '&quot;, sourceText, &quot;')&quot;);
+}
+
+static String invalidParameterInstanceofSourceAppender(const String&amp; originalMessage, const String&amp; sourceText, RuntimeType, ErrorInstance::SourceTextWhereErrorOccurred occurrence)
+{
+    if (occurrence == ErrorInstance::FoundApproximateSource)
+        return defaultApproximateSourceError(originalMessage, sourceText);
+
+    ASSERT(occurrence == ErrorInstance::FoundExactSource);
+    auto instanceofIndex = sourceText.reverseFind(&quot;instanceof&quot;);
+    RELEASE_ASSERT(instanceofIndex != notFound);
+    if (sourceText.find(&quot;instanceof&quot;) != instanceofIndex)
+        return makeString(originalMessage, &quot; (evaluating '&quot;, sourceText, &quot;')&quot;);
+
+    static const unsigned instanceofLength = 10;
+    String rightHandSide = sourceText.substring(instanceofIndex + instanceofLength).simplifyWhiteSpace();
+    return makeString(rightHandSide, &quot; is not a function. (evaluating '&quot;, sourceText, &quot;')&quot;);
+}
+
+JSObject* createError(ExecState* exec, ErrorFactory errorFactory, JSValue value, const String&amp; message, ErrorInstance::SourceAppender appender)
+{
</ins><span class="cx">     String errorMessage = makeString(errorDescriptionForValue(exec, value)-&gt;value(exec), ' ', message);
</span><span class="cx">     JSObject* exception = errorFactory(exec, errorMessage);
</span><span class="cx">     ASSERT(exception-&gt;isErrorInstance());
</span><del>-    static_cast&lt;ErrorInstance*&gt;(exception)-&gt;setAppendSourceToMessage();
</del><ins>+    static_cast&lt;ErrorInstance*&gt;(exception)-&gt;setSourceAppender(appender);
+    static_cast&lt;ErrorInstance*&gt;(exception)-&gt;setRuntimeTypeForCause(runtimeTypeForValue(value));
</ins><span class="cx">     return exception;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSObject* createInvalidParameterError(ExecState* exec, const char* op, JSValue value)
</del><ins>+JSObject* createInvalidFunctionApplyParameterError(ExecState* exec, JSValue value)
</ins><span class="cx"> {
</span><del>-    return createError(exec, createTypeError, value, makeString(&quot;is not a valid argument for '&quot;, op, '\''));
</del><ins>+    JSObject* exception = createTypeError(exec, makeString(&quot;second argument to Function.prototype.apply must be an Array-like object&quot;));
+    ASSERT(exception-&gt;isErrorInstance());
+    static_cast&lt;ErrorInstance*&gt;(exception)-&gt;setSourceAppender(defaultSourceAppender);
+    static_cast&lt;ErrorInstance*&gt;(exception)-&gt;setRuntimeTypeForCause(runtimeTypeForValue(value));
+    return exception;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+JSObject* createInvalidInParameterError(ExecState* exec, JSValue value)
+{
+    return createError(exec, createTypeError, value, makeString(&quot;is not an Object.&quot;), invalidParameterInSourceAppender);
+}
+
+JSObject* createInvalidInstanceofParameterError(ExecState* exec, JSValue value)
+{
+    return createError(exec, createTypeError, value, makeString(&quot;is not a function.&quot;), invalidParameterInstanceofSourceAppender);
+}
+
</ins><span class="cx"> JSObject* createNotAConstructorError(ExecState* exec, JSValue value)
</span><span class="cx"> {
</span><del>-    return createError(exec, createTypeError, value, ASCIILiteral(&quot;is not a constructor&quot;));
</del><ins>+    return createError(exec, createTypeError, value, ASCIILiteral(&quot;is not a constructor&quot;), defaultSourceAppender);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSObject* createNotAFunctionError(ExecState* exec, JSValue value)
</span><span class="cx"> {
</span><del>-    return createError(exec, createTypeError, value, ASCIILiteral(&quot;is not a function&quot;));
</del><ins>+    return createError(exec, createTypeError, value, ASCIILiteral(&quot;is not a function&quot;), notAFunctionSourceAppender);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSObject* createNotAnObjectError(ExecState* exec, JSValue value)
</span><span class="cx"> {
</span><del>-    return createError(exec, createTypeError, value, ASCIILiteral(&quot;is not an object&quot;));
</del><ins>+    return createError(exec, createTypeError, value, ASCIILiteral(&quot;is not an object&quot;), defaultSourceAppender);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSObject* createErrorForInvalidGlobalAssignment(ExecState* exec, const String&amp; propertyName)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeExceptionHelpersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.h (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.h        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.h        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #ifndef ExceptionHelpers_h
</span><span class="cx"> #define ExceptionHelpers_h
</span><span class="cx"> 
</span><ins>+#include &quot;ErrorInstance.h&quot;
</ins><span class="cx"> #include &quot;JSObject.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="lines">@@ -38,13 +39,15 @@
</span><span class="cx"> JSObject* createTerminatedExecutionException(VM*);
</span><span class="cx"> bool isTerminatedExecutionException(JSObject*);
</span><span class="cx"> JS_EXPORT_PRIVATE bool isTerminatedExecutionException(JSValue);
</span><del>-JS_EXPORT_PRIVATE JSObject* createError(ExecState*, ErrorFactory, JSValue, const String&amp;);
</del><ins>+JS_EXPORT_PRIVATE JSObject* createError(ExecState*, ErrorFactory, JSValue, const String&amp;, ErrorInstance::SourceAppender);
</ins><span class="cx"> JS_EXPORT_PRIVATE JSObject* createStackOverflowError(ExecState*);
</span><span class="cx"> JSObject* createStackOverflowError(JSGlobalObject*);
</span><span class="cx"> JSObject* createOutOfMemoryError(JSGlobalObject*);
</span><span class="cx"> JSObject* createUndefinedVariableError(ExecState*, const Identifier&amp;);
</span><span class="cx"> JSObject* createNotAnObjectError(ExecState*, JSValue);
</span><del>-JSObject* createInvalidParameterError(ExecState*, const char* op, JSValue);
</del><ins>+JSObject* createInvalidFunctionApplyParameterError(ExecState*, JSValue);
+JSObject* createInvalidInParameterError(ExecState*, JSValue);
+JSObject* createInvalidInstanceofParameterError(ExecState*, JSValue);
</ins><span class="cx"> JSObject* createNotAConstructorError(ExecState*, JSValue);
</span><span class="cx"> JSObject* createNotAFunctionError(ExecState*, JSValue);
</span><span class="cx"> JSObject* createErrorForInvalidGlobalAssignment(ExecState*, const String&amp;);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSObject.cpp (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSObject.cpp        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/Source/JavaScriptCore/runtime/JSObject.cpp        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -1471,7 +1471,7 @@
</span><span class="cx">         return defaultHasInstance(exec, value, get(exec, exec-&gt;propertyNames().prototype));
</span><span class="cx">     if (info.implementsHasInstance())
</span><span class="cx">         return methodTable(vm)-&gt;customHasInstance(this, exec, value);
</span><del>-    vm.throwException(exec, createInvalidParameterError(exec, &quot;instanceof&quot; , this));
</del><ins>+    vm.throwException(exec, createInvalidInstanceofParameterError(exec, this));
</ins><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeRuntimeTypecpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/runtime/RuntimeType.cpp (0 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/RuntimeType.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/runtime/RuntimeType.cpp        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -0,0 +1,83 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ * Copyright (C) Saam Barati &lt;saambarati1@gmail.com&gt;. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+
+#include &quot;config.h&quot;
+#include &quot;RuntimeType.h&quot;
+
+#include &quot;JSCJSValue.h&quot;
+#include &quot;JSCJSValueInlines.h&quot;
+
+namespace JSC {
+
+RuntimeType runtimeTypeForValue(JSValue value)
+{
+    if (value.isUndefined())
+        return TypeUndefined;
+    if (value.isNull())
+        return TypeNull;
+    if (value.isMachineInt())
+        return TypeMachineInt;
+    if (value.isNumber())
+        return TypeNumber;
+    if (value.isString())
+        return TypeString;
+    if (value.isBoolean())
+        return TypeBoolean;
+    if (value.isObject())
+        return TypeObject;
+    if (value.isFunction())
+        return TypeFunction;
+
+    return TypeNothing;
+}
+
+String runtimeTypeAsString(RuntimeType type)
+{
+    if (type == TypeUndefined)
+        return ASCIILiteral(&quot;Undefined&quot;);
+    if (type == TypeNull)
+        return ASCIILiteral(&quot;Null&quot;);
+    if (type == TypeMachineInt)
+        return ASCIILiteral(&quot;Integer&quot;);
+    if (type == TypeNumber)
+        return ASCIILiteral(&quot;Number&quot;);
+    if (type == TypeString)
+        return ASCIILiteral(&quot;String&quot;);
+    if (type == TypeObject)
+        return ASCIILiteral(&quot;Object&quot;);
+    if (type == TypeBoolean)
+        return ASCIILiteral(&quot;Boolean&quot;);
+    if (type == TypeFunction)
+        return ASCIILiteral(&quot;Function&quot;);
+    if (type == TypeNothing)
+        return ASCIILiteral(&quot;(Nothing)&quot;);
+
+    RELEASE_ASSERT_NOT_REACHED();
+    return emptyString();
+}
+
+} // namespace JSC
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeRuntimeTypeh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/runtime/RuntimeType.h (0 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/RuntimeType.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/runtime/RuntimeType.h        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ * Copyright (C) Saam Barati &lt;saambarati1@gmail.com&gt;. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef RuntimeType_h
+#define RuntimeType_h
+
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace JSC {
+
+enum RuntimeType : uint8_t {
+    TypeNothing            = 0x0,
+    TypeFunction           = 0x1,
+    TypeUndefined          = 0x2,
+    TypeNull               = 0x4,
+    TypeBoolean            = 0x8,
+    TypeMachineInt         = 0x10,
+    TypeNumber             = 0x20,
+    TypeString             = 0x40,
+    TypeObject             = 0x80
+};
+
+class JSValue;
+RuntimeType runtimeTypeForValue(JSValue);
+String runtimeTypeAsString(RuntimeType);
+
+} // namespace JSC
+
+#endif // RuntimeType_h
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeTypeProfilerLogcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/TypeProfilerLog.cpp (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/TypeProfilerLog.cpp        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/Source/JavaScriptCore/runtime/TypeProfilerLog.cpp        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx">                 shape = iter-&gt;value;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        RuntimeType type = TypeSet::getRuntimeTypeForValue(value);
</del><ins>+        RuntimeType type = runtimeTypeForValue(value);
</ins><span class="cx">         TypeLocation* location = entry-&gt;location;
</span><span class="cx">         location-&gt;m_lastSeenType = type;
</span><span class="cx">         if (location-&gt;m_globalTypeSet)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeTypeSetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/TypeSet.cpp (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/TypeSet.cpp        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/Source/JavaScriptCore/runtime/TypeSet.cpp        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -42,31 +42,6 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RuntimeType TypeSet::getRuntimeTypeForValue(JSValue v)
-{
-    RuntimeType ret;
-    if (v.isFunction())
-        ret = TypeFunction;
-    else if (v.isUndefined())
-        ret = TypeUndefined;
-    else if (v.isNull())
-        ret = TypeNull;
-    else if (v.isBoolean())
-        ret = TypeBoolean;
-    else if (v.isMachineInt())
-        ret = TypeMachineInt;
-    else if (v.isNumber())
-        ret = TypeNumber;
-    else if (v.isString())
-        ret = TypeString;
-    else if (v.isObject())
-        ret = TypeObject;
-    else
-        ret = TypeNothing;
-
-    return ret;
-}
-
</del><span class="cx"> void TypeSet::addTypeInformation(RuntimeType type, PassRefPtr&lt;StructureShape&gt; prpNewShape, Structure* structure) 
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;StructureShape&gt; newShape = prpNewShape;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeTypeSeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/TypeSet.h (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/TypeSet.h        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/Source/JavaScriptCore/runtime/TypeSet.h        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #ifndef TypeSet_h
</span><span class="cx"> #define TypeSet_h
</span><span class="cx"> 
</span><ins>+#include &quot;RuntimeType.h&quot;
</ins><span class="cx"> #include &quot;StructureSet.h&quot;
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="lines">@@ -46,20 +47,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><del>-class JSValue;
-
-enum RuntimeType : uint8_t {
-    TypeNothing            = 0x0,
-    TypeFunction           = 0x1,
-    TypeUndefined          = 0x2,
-    TypeNull               = 0x4,
-    TypeBoolean            = 0x8,
-    TypeMachineInt         = 0x10,
-    TypeNumber             = 0x20,
-    TypeString             = 0x40,
-    TypeObject             = 0x80
-};
-
</del><span class="cx"> class StructureShape : public RefCounted&lt;StructureShape&gt; {
</span><span class="cx">     friend class TypeSet;
</span><span class="cx"> 
</span><span class="lines">@@ -98,7 +85,6 @@
</span><span class="cx">     static PassRefPtr&lt;TypeSet&gt; create() { return adoptRef(new TypeSet); }
</span><span class="cx">     TypeSet();
</span><span class="cx">     void addTypeInformation(RuntimeType, PassRefPtr&lt;StructureShape&gt;, Structure*);
</span><del>-    static RuntimeType getRuntimeTypeForValue(JSValue);
</del><span class="cx">     void invalidateCache();
</span><span class="cx">     String dumpTypes() const;
</span><span class="cx">     String displayName() const;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VM.cpp (181888 => 181889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VM.cpp        2015-03-24 06:47:40 UTC (rev 181888)
+++ trunk/Source/JavaScriptCore/runtime/VM.cpp        2015-03-24 07:30:05 UTC (rev 181889)
</span><span class="lines">@@ -75,6 +75,7 @@
</span><span class="cx"> #include &quot;PropertyMapHashTable.h&quot;
</span><span class="cx"> #include &quot;RegExpCache.h&quot;
</span><span class="cx"> #include &quot;RegExpObject.h&quot;
</span><ins>+#include &quot;RuntimeType.h&quot;
</ins><span class="cx"> #include &quot;SimpleTypedArrayController.h&quot;
</span><span class="cx"> #include &quot;SourceProviderCache.h&quot;
</span><span class="cx"> #include &quot;StackVisitor.h&quot;
</span><span class="lines">@@ -540,7 +541,10 @@
</span><span class="cx"> 
</span><span class="cx"> static void appendSourceToError(CallFrame* callFrame, ErrorInstance* exception, unsigned bytecodeOffset)
</span><span class="cx"> {
</span><del>-    exception-&gt;clearAppendSourceToMessage();
</del><ins>+    ErrorInstance::SourceAppender appender = exception-&gt;sourceAppender();
+    exception-&gt;clearSourceAppender();
+    RuntimeType type = exception-&gt;runtimeTypeForCause();
+    exception-&gt;clearRuntimeTypeForCause();
</ins><span class="cx">     
</span><span class="cx">     if (!callFrame-&gt;codeBlock()-&gt;hasExpressionInfo())
</span><span class="cx">         return;
</span><span class="lines">@@ -569,7 +573,7 @@
</span><span class="cx">     String message = asString(jsMessage)-&gt;value(callFrame);
</span><span class="cx">     
</span><span class="cx">     if (expressionStart &lt; expressionStop)
</span><del>-        message =  makeString(message, &quot; (evaluating '&quot;, codeBlock-&gt;source()-&gt;getRange(expressionStart, expressionStop), &quot;')&quot;);
</del><ins>+        message = appender(message, codeBlock-&gt;source()-&gt;getRange(expressionStart, expressionStop), type, ErrorInstance::FoundExactSource);
</ins><span class="cx">     else {
</span><span class="cx">         // No range information, so give a few characters of context.
</span><span class="cx">         const StringImpl* data = sourceString.impl();
</span><span class="lines">@@ -586,7 +590,7 @@
</span><span class="cx">             stop++;
</span><span class="cx">         while (stop &gt; expressionStart &amp;&amp; isStrWhiteSpace((*data)[stop - 1]))
</span><span class="cx">             stop--;
</span><del>-        message = makeString(message, &quot; (near '...&quot;, codeBlock-&gt;source()-&gt;getRange(start, stop), &quot;...')&quot;);
</del><ins>+        message = appender(message, codeBlock-&gt;source()-&gt;getRange(start, stop), type, ErrorInstance::FoundApproximateSource);
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     exception-&gt;putDirect(*vm, vm-&gt;propertyNames-&gt;message, jsString(vm, message));
</span><span class="lines">@@ -662,7 +666,7 @@
</span><span class="cx">         if (!stackFrame.sourceURL.isEmpty())
</span><span class="cx">             exception-&gt;putDirect(*this, Identifier(this, &quot;sourceURL&quot;), jsString(this, stackFrame.sourceURL), ReadOnly | DontDelete);
</span><span class="cx">     }
</span><del>-    if (exception-&gt;isErrorInstance() &amp;&amp; static_cast&lt;ErrorInstance*&gt;(exception)-&gt;appendSourceToMessage()) {
</del><ins>+    if (exception-&gt;isErrorInstance() &amp;&amp; static_cast&lt;ErrorInstance*&gt;(exception)-&gt;hasSourceAppender()) {
</ins><span class="cx">         FindFirstCallerFrameWithCodeblockFunctor functor(exec);
</span><span class="cx">         topCallFrame-&gt;iterate(functor);
</span><span class="cx">         CallFrame* callFrame = functor.foundCallFrame();
</span></span></pre>
</div>
</div>

</body>
</html>