<!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>[181886] trunk/LayoutTests</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/181886">181886</a></dd>
<dt>Author</dt> <dd>fpizlo@apple.com</dd>
<dt>Date</dt> <dd>2015-03-23 18:48:54 -0700 (Mon, 23 Mar 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move the bulk of the js/dom/const test into js/const, so that run-jsc-stress-tests runs it.

Rubber stamped by Andreas Kling and Michael Saboff.

* js/const-expected.txt: Copied from LayoutTests/js/dom/const-expected.txt.
* js/const.html: Copied from LayoutTests/js/dom/const.html.
* js/dom/const-expected.txt: Replaced.
* js/dom/const.html: Replaced.
* js/resources/const.js: Removed.
* js/script-tests/const.js: Copied from LayoutTests/js/resources/const.js.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsjsconstexpectedtxt">trunk/LayoutTests/js/const-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsconsthtml">trunk/LayoutTests/js/const.html</a></li>
<li><a href="#trunkLayoutTestsjsdomconstexpectedtxt">trunk/LayoutTests/js/dom/const-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomconsthtml">trunk/LayoutTests/js/dom/const.html</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsconstjs">trunk/LayoutTests/js/script-tests/const.js</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsjsdomconstexpectedtxt">trunk/LayoutTests/js/dom/const-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsdomconsthtml">trunk/LayoutTests/js/dom/const.html</a></li>
<li><a href="#trunkLayoutTestsjsresourcesconstjs">trunk/LayoutTests/js/resources/const.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (181885 => 181886)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-03-24 01:28:06 UTC (rev 181885)
+++ trunk/LayoutTests/ChangeLog        2015-03-24 01:48:54 UTC (rev 181886)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2015-03-23  Filip Pizlo  &lt;fpizlo@apple.com&gt;
+
+        Move the bulk of the js/dom/const test into js/const, so that run-jsc-stress-tests runs it.
+
+        Rubber stamped by Andreas Kling and Michael Saboff.
+
+        * js/const-expected.txt: Copied from LayoutTests/js/dom/const-expected.txt.
+        * js/const.html: Copied from LayoutTests/js/dom/const.html.
+        * js/dom/const-expected.txt: Replaced.
+        * js/dom/const.html: Replaced.
+        * js/resources/const.js: Removed.
+        * js/script-tests/const.js: Copied from LayoutTests/js/resources/const.js.
+
</ins><span class="cx"> 2015-03-23  Andy Estes  &lt;aestes@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Content Filtering] Fix up a few mistakes in LayoutTests/contentfiltering/
</span></span></pre></div>
<a id="trunkLayoutTestsjsconstexpectedtxtfromrev181875trunkLayoutTestsjsdomconstexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/js/const-expected.txt (from rev 181875, trunk/LayoutTests/js/dom/const-expected.txt) (0 => 181886)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/const-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/const-expected.txt        2015-03-24 01:48:54 UTC (rev 181886)
</span><span class="lines">@@ -0,0 +1,68 @@
</span><ins>+This test checks that const declarations in JavaScript work and are readonly.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+FAIL const redef='a'; const redef='a'; should throw an exception. Was undefined.
+PASS x is &quot;RIGHT&quot;
+PASS y is &quot;RIGHT&quot;
+PASS a is 1
+PASS one is 1
+PASS a is 1
+PASS one is 1
+PASS a is 2
+PASS one is 1
+PASS a is 0
+PASS one is 1
+PASS a is 3
+PASS one is 1
+PASS a is 2
+PASS one is 1
+PASS function f() { const one = 1; one++; return one; } f(); is 1
+PASS function f() { const oneString = '1'; return oneString++; } f(); is 1
+PASS function f() { const one = 1; return one++; } f(); is 1
+PASS function f() { const one = 1; one--; return one; } f(); is 1
+PASS function f() { const oneString = '1'; return oneString--; } f(); is 1
+PASS function f() { const one = 1; return one--; } f(); is 1
+PASS function f() { const one = 1; ++one; return one; } f(); is 1
+PASS function f() { const one = 1; return ++one; } f(); is 2
+PASS function f() { const one = 1; --one; return one; } f(); is 1
+PASS function f() { const one = 1; return --one; } f(); is 0
+PASS function f() { const one = 1; one += 2; return one; } f(); is 1
+PASS function f() { const one = 1; return one += 2; } f(); is 3
+PASS function f() { const one = 1; one = 2; return one; } f(); is 1
+PASS function f() { const one = 1; return one = 2; } f(); is 2
+PASS one++ is 1
+PASS one is 1
+PASS one-- is 1
+PASS one is 1
+PASS ++one is 2
+PASS one is 1
+PASS --one is 0
+PASS one is 1
+PASS one += 1 is 2
+PASS one is 1
+PASS one = 2 is 2
+PASS one is 1
+PASS object.inWith1 is 'RIGHT'
+PASS inWith2 is 'RIGHT'
+PASS (function(){ one = 2; return one; })() is 1
+PASS f() is f
+PASS const a; is undefined
+PASS tryCatch1Result is 5
+PASS tryCatch2Result is 5
+PASS with1Result is 5
+PASS with2Result is 5
+PASS PASS: ++x should be 2 and is.
+PASS PASS: --x should be 0 and is.
+PASS PASS: x should be 1 and is.
+PASS PASS: x++ should be 1 and is.
+PASS PASS: x should be 1 and is.
+PASS PASS: ++x should be 2 and is.
+PASS PASS: x should be 1 and is.
+PASS PASS: x++ should be 1 and is.
+PASS PASS: x should be 1 and is.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsconsthtmlfromrev181875trunkLayoutTestsjsdomconsthtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/js/const.html (from rev 181875, trunk/LayoutTests/js/dom/const.html) (0 => 181886)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/const.html                                (rev 0)
+++ trunk/LayoutTests/js/const.html        2015-03-24 01:48:54 UTC (rev 181886)
</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/const.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="trunkLayoutTestsjsdomconstexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/js/dom/const-expected.txt (181885 => 181886)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/const-expected.txt        2015-03-24 01:28:06 UTC (rev 181885)
+++ trunk/LayoutTests/js/dom/const-expected.txt        2015-03-24 01:48:54 UTC (rev 181886)
</span><span class="lines">@@ -1,70 +0,0 @@
</span><del>-This test checks that const declarations in JavaScript work and are readonly.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-FAIL const redef='a'; const redef='a'; should throw an exception. Was undefined.
-PASS x is &quot;RIGHT&quot;
-PASS y is &quot;RIGHT&quot;
-PASS a is 1
-PASS one is 1
-PASS a is 1
-PASS one is 1
-PASS a is 2
-PASS one is 1
-PASS a is 0
-PASS one is 1
-PASS a is 3
-PASS one is 1
-PASS a is 2
-PASS one is 1
-PASS function f() { const one = 1; one++; return one; } f(); is 1
-PASS function f() { const oneString = '1'; return oneString++; } f(); is 1
-PASS function f() { const one = 1; return one++; } f(); is 1
-PASS function f() { const one = 1; one--; return one; } f(); is 1
-PASS function f() { const oneString = '1'; return oneString--; } f(); is 1
-PASS function f() { const one = 1; return one--; } f(); is 1
-PASS function f() { const one = 1; ++one; return one; } f(); is 1
-PASS function f() { const one = 1; return ++one; } f(); is 2
-PASS function f() { const one = 1; --one; return one; } f(); is 1
-PASS function f() { const one = 1; return --one; } f(); is 0
-PASS function f() { const one = 1; one += 2; return one; } f(); is 1
-PASS function f() { const one = 1; return one += 2; } f(); is 3
-PASS function f() { const one = 1; one = 2; return one; } f(); is 1
-PASS function f() { const one = 1; return one = 2; } f(); is 2
-PASS one++ is 1
-PASS one is 1
-PASS one-- is 1
-PASS one is 1
-PASS ++one is 2
-PASS one is 1
-PASS --one is 0
-PASS one is 1
-PASS one += 1 is 2
-PASS one is 1
-PASS one = 2 is 2
-PASS one is 1
-PASS object.inWith1 is 'RIGHT'
-PASS inWith2 is 'RIGHT'
-PASS (function(){ one = 2; return one; })() is 1
-PASS f() is f
-PASS const a; is undefined
-PASS bodyId is document.getElementById('bodyId')
-PASS ranConstInitialiser is true
-PASS tryCatch1Result is 5
-PASS tryCatch2Result is 5
-PASS with1Result is 5
-PASS with2Result is 5
-PASS PASS: ++x should be 2 and is.
-PASS PASS: --x should be 0 and is.
-PASS PASS: x should be 1 and is.
-PASS PASS: x++ should be 1 and is.
-PASS PASS: x should be 1 and is.
-PASS PASS: ++x should be 2 and is.
-PASS PASS: x should be 1 and is.
-PASS PASS: x++ should be 1 and is.
-PASS PASS: x should be 1 and is.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestsjsdomconstexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/dom/const-expected.txt (0 => 181886)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/const-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/dom/const-expected.txt        2015-03-24 01:48:54 UTC (rev 181886)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+This test checks that const declarations in JavaScript work and are readonly.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS bodyId is document.getElementById('bodyId')
+PASS ranConstInitialiser is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsdomconsthtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/js/dom/const.html (181885 => 181886)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/const.html        2015-03-24 01:28:06 UTC (rev 181885)
+++ trunk/LayoutTests/js/dom/const.html        2015-03-24 01:48:54 UTC (rev 181886)
</span><span class="lines">@@ -1,10 +0,0 @@
</span><del>-&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 id=&quot;bodyId&quot;&gt;
-&lt;script src=&quot;../resources/const.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;
</del></span></pre></div>
<a id="trunkLayoutTestsjsdomconsthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/dom/const.html (0 => 181886)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/dom/const.html                                (rev 0)
+++ trunk/LayoutTests/js/dom/const.html        2015-03-24 01:48:54 UTC (rev 181886)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+&lt;!DOCTYPE HTML&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;Const test&lt;/title&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body id=&quot;bodyId&quot;&gt;
+&lt;script&gt;
+description(
+&quot;This test checks that const declarations in JavaScript work and are readonly.&quot;
+);
+
+// Make sure we don't override properties placed on the global object
+var ranConstInitialiser = false;
+const bodyId = (ranConstInitialiser = true, &quot;Const initialiser overwrote existing property&quot;);
+shouldBe(&quot;bodyId&quot;, &quot;document.getElementById('bodyId')&quot;);
+shouldBeTrue(&quot;ranConstInitialiser&quot;);
+&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="trunkLayoutTestsjsresourcesconstjs"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/js/resources/const.js (181885 => 181886)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/resources/const.js        2015-03-24 01:28:06 UTC (rev 181885)
+++ trunk/LayoutTests/js/resources/const.js        2015-03-24 01:48:54 UTC (rev 181886)
</span><span class="lines">@@ -1,190 +0,0 @@
</span><del>-description(
-&quot;This test checks that const declarations in JavaScript work and are readonly.&quot;
-);
-
-
-shouldThrow(&quot;const redef='a'; const redef='a';&quot;);
-
-const x = &quot;RIGHT&quot;;
-x = &quot;WRONG&quot;;
-shouldBe(&quot;x&quot;, '&quot;RIGHT&quot;');
-
-const z = &quot;RIGHT&quot;, y = &quot;RIGHT&quot;;
-y = &quot;WRONG&quot;;
-shouldBe(&quot;y&quot;, '&quot;RIGHT&quot;');
-
-const one = 1;
-
-var a;
-
-// PostIncResolveNode
-a = one++;
-shouldBe(&quot;a&quot;, &quot;1&quot;);
-shouldBe(&quot;one&quot;, &quot;1&quot;);
-
-// PostDecResolveNode
-a = one--;
-shouldBe(&quot;a&quot;, &quot;1&quot;);
-shouldBe(&quot;one&quot;, &quot;1&quot;);
-
-// PreIncResolveNode
-a = ++one;
-shouldBe(&quot;a&quot;, &quot;2&quot;);
-shouldBe(&quot;one&quot;, &quot;1&quot;);
-
-// PreDecResolveNode
-a = --one;
-shouldBe(&quot;a&quot;, &quot;0&quot;);
-shouldBe(&quot;one&quot;, &quot;1&quot;);
-
-// ReadModifyConstNode
-a = one += 2;
-shouldBe(&quot;a&quot;, &quot;3&quot;);
-shouldBe(&quot;one&quot;, &quot;1&quot;);
-
-// AssignConstNode
-a = one = 2;
-shouldBe(&quot;a&quot;, &quot;2&quot;);
-shouldBe(&quot;one&quot;, &quot;1&quot;);
-
-// PostIncResolveNode
-shouldBe(&quot;function f() { const one = 1; one++; return one; } f();&quot;, &quot;1&quot;);
-shouldBe(&quot;function f() { const oneString = '1'; return oneString++; } f();&quot;, &quot;1&quot;);
-shouldBe(&quot;function f() { const one = 1; return one++; } f();&quot;, &quot;1&quot;);
-
-// PostDecResolveNode
-shouldBe(&quot;function f() { const one = 1; one--; return one; } f();&quot;, &quot;1&quot;);
-shouldBe(&quot;function f() { const oneString = '1'; return oneString--; } f();&quot;, &quot;1&quot;);
-shouldBe(&quot;function f() { const one = 1; return one--; } f();&quot;, &quot;1&quot;);
-
-// PreIncResolveNode
-shouldBe(&quot;function f() { const one = 1; ++one; return one; } f();&quot;, &quot;1&quot;);
-shouldBe(&quot;function f() { const one = 1; return ++one; } f();&quot;, &quot;2&quot;);
-
-// PreDecResolveNode
-shouldBe(&quot;function f() { const one = 1; --one; return one; } f();&quot;, &quot;1&quot;);
-shouldBe(&quot;function f() { const one = 1; return --one; } f();&quot;, &quot;0&quot;);
-
-// ReadModifyConstNode
-shouldBe(&quot;function f() { const one = 1; one += 2; return one; } f();&quot;, &quot;1&quot;);
-shouldBe(&quot;function f() { const one = 1; return one += 2; } f();&quot;, &quot;3&quot;);
-
-// AssignConstNode
-shouldBe(&quot;function f() { const one = 1; one = 2; return one; } f();&quot;, &quot;1&quot;);
-shouldBe(&quot;function f() { const one = 1; return one = 2; } f();&quot;, &quot;2&quot;);
-
-// PostIncResolveNode
-shouldBe(&quot;one++&quot;, &quot;1&quot;);
-shouldBe(&quot;one&quot;, &quot;1&quot;);
-
-// PostDecResolveNode
-shouldBe(&quot;one--&quot;, &quot;1&quot;);
-shouldBe(&quot;one&quot;, &quot;1&quot;);
-
-// PreIncResolveNode
-shouldBe(&quot;++one&quot;, &quot;2&quot;);
-shouldBe(&quot;one&quot;, &quot;1&quot;);
-
-// PreDecResolveNode
-shouldBe(&quot;--one&quot;, &quot;0&quot;);
-shouldBe(&quot;one&quot;, &quot;1&quot;);
-
-// ReadModifyConstNode
-shouldBe(&quot;one += 1&quot;, &quot;2&quot;);
-shouldBe(&quot;one&quot;, &quot;1&quot;);
-
-// AssignConstNode
-shouldBe(&quot;one = 2&quot;, &quot;2&quot;);
-shouldBe(&quot;one&quot;, &quot;1&quot;);
-
-var object = { inWith1: &quot;RIGHT&quot;, inWith2: &quot;&quot;}
-with (object) {
-    const inWith1 = &quot;WRONG&quot;;
-    const inWith2 = &quot;RIGHT&quot;;
-    inWith2 = &quot;WRONG&quot;;
-}
-shouldBe(&quot;object.inWith1&quot;, &quot;'RIGHT'&quot;);
-shouldBe(&quot;inWith2&quot;, &quot;'RIGHT'&quot;);
-
-shouldBe(&quot;(function(){ one = 2; return one; })()&quot;, &quot;1&quot;)
-var f = function g() { g=&quot;FAIL&quot;; return g; };
-shouldBe(&quot;f()&quot;, &quot;f&quot;);
-
-shouldBe(&quot;const a;&quot;, &quot;undefined&quot;);
-
-// Make sure we don't override properties placed on the global object
-var ranConstInitialiser = false;
-const bodyId = (ranConstInitialiser = true, &quot;Const initialiser overwrote existing property&quot;);
-shouldBe(&quot;bodyId&quot;, &quot;document.getElementById('bodyId')&quot;);
-shouldBeTrue(&quot;ranConstInitialiser&quot;);
-
-// Make sure that dynamic scopes (catch, with) don't break const declarations
-function tryCatch1() {
-    var bar;
-    eval(&quot;try {\
-        stuff();\
-    } catch (e) {\
-        const bar = 5;\
-    }&quot;);
-    return bar;
-}
-
-function tryCatch2() {
-    var bar;
-    try {
-        stuff();
-    } catch (e) {
-        const bar = 5;
-    }
-    return bar;
-}
-
-tryCatch1Result = tryCatch1();
-shouldBe(&quot;tryCatch1Result&quot;, &quot;5&quot;);
-tryCatch2Result = tryCatch2();
-shouldBe(&quot;tryCatch2Result&quot;, &quot;5&quot;);
-
-function with1() {
-    var bar;
-    eval(&quot;with({foo:42}) const bar = 5;&quot;);
-    return bar;
-}
-
-function with2() {
-    var bar;
-    with({foo:42}) const bar = 5;
-    return bar;
-}
-
-with1Result = with1();
-shouldBe(&quot;with1Result&quot;, &quot;5&quot;);
-with2Result = with2();
-shouldBe(&quot;with2Result&quot;, &quot;5&quot;);
-
-(function () {
-    function shouldBe(aDescription, a, b)
-    {
-        if (a === b) {
-            testPassed(&quot;PASS: &quot; + aDescription + &quot; should be &quot; + b + &quot; and is.&quot;);
-            return;
-        }
-
-        testFailed(&quot;FAIL: &quot; + aDescription + &quot; should be &quot; + b + &quot; but instead is &quot; + a + &quot;.&quot;);
-    }
-
-    (function() {
-        const x = &quot;1&quot;;
-        shouldBe(&quot;++x&quot;, ++x, 2);
-        shouldBe(&quot;--x&quot;, --x, 0);
-        shouldBe(&quot;x&quot;, x, &quot;1&quot;);
-        shouldBe(&quot;x++&quot;, x++, 1);
-        shouldBe(&quot;x&quot;, x, &quot;1&quot;);
-    })();
-    (function() {
-        const x = 1;
-        shouldBe(&quot;++x&quot;, ++x, 2);
-        shouldBe(&quot;x&quot;, x, 1);
-        shouldBe(&quot;x++&quot;, x++, 1);
-        shouldBe(&quot;x&quot;, x, 1);
-    })();
-})();
</del></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsconstjsfromrev181875trunkLayoutTestsjsresourcesconstjs"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/js/script-tests/const.js (from rev 181875, trunk/LayoutTests/js/resources/const.js) (0 => 181886)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/const.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/const.js        2015-03-24 01:48:54 UTC (rev 181886)
</span><span class="lines">@@ -0,0 +1,184 @@
</span><ins>+description(
+&quot;This test checks that const declarations in JavaScript work and are readonly.&quot;
+);
+
+
+shouldThrow(&quot;const redef='a'; const redef='a';&quot;);
+
+const x = &quot;RIGHT&quot;;
+x = &quot;WRONG&quot;;
+shouldBe(&quot;x&quot;, '&quot;RIGHT&quot;');
+
+const z = &quot;RIGHT&quot;, y = &quot;RIGHT&quot;;
+y = &quot;WRONG&quot;;
+shouldBe(&quot;y&quot;, '&quot;RIGHT&quot;');
+
+const one = 1;
+
+var a;
+
+// PostIncResolveNode
+a = one++;
+shouldBe(&quot;a&quot;, &quot;1&quot;);
+shouldBe(&quot;one&quot;, &quot;1&quot;);
+
+// PostDecResolveNode
+a = one--;
+shouldBe(&quot;a&quot;, &quot;1&quot;);
+shouldBe(&quot;one&quot;, &quot;1&quot;);
+
+// PreIncResolveNode
+a = ++one;
+shouldBe(&quot;a&quot;, &quot;2&quot;);
+shouldBe(&quot;one&quot;, &quot;1&quot;);
+
+// PreDecResolveNode
+a = --one;
+shouldBe(&quot;a&quot;, &quot;0&quot;);
+shouldBe(&quot;one&quot;, &quot;1&quot;);
+
+// ReadModifyConstNode
+a = one += 2;
+shouldBe(&quot;a&quot;, &quot;3&quot;);
+shouldBe(&quot;one&quot;, &quot;1&quot;);
+
+// AssignConstNode
+a = one = 2;
+shouldBe(&quot;a&quot;, &quot;2&quot;);
+shouldBe(&quot;one&quot;, &quot;1&quot;);
+
+// PostIncResolveNode
+shouldBe(&quot;function f() { const one = 1; one++; return one; } f();&quot;, &quot;1&quot;);
+shouldBe(&quot;function f() { const oneString = '1'; return oneString++; } f();&quot;, &quot;1&quot;);
+shouldBe(&quot;function f() { const one = 1; return one++; } f();&quot;, &quot;1&quot;);
+
+// PostDecResolveNode
+shouldBe(&quot;function f() { const one = 1; one--; return one; } f();&quot;, &quot;1&quot;);
+shouldBe(&quot;function f() { const oneString = '1'; return oneString--; } f();&quot;, &quot;1&quot;);
+shouldBe(&quot;function f() { const one = 1; return one--; } f();&quot;, &quot;1&quot;);
+
+// PreIncResolveNode
+shouldBe(&quot;function f() { const one = 1; ++one; return one; } f();&quot;, &quot;1&quot;);
+shouldBe(&quot;function f() { const one = 1; return ++one; } f();&quot;, &quot;2&quot;);
+
+// PreDecResolveNode
+shouldBe(&quot;function f() { const one = 1; --one; return one; } f();&quot;, &quot;1&quot;);
+shouldBe(&quot;function f() { const one = 1; return --one; } f();&quot;, &quot;0&quot;);
+
+// ReadModifyConstNode
+shouldBe(&quot;function f() { const one = 1; one += 2; return one; } f();&quot;, &quot;1&quot;);
+shouldBe(&quot;function f() { const one = 1; return one += 2; } f();&quot;, &quot;3&quot;);
+
+// AssignConstNode
+shouldBe(&quot;function f() { const one = 1; one = 2; return one; } f();&quot;, &quot;1&quot;);
+shouldBe(&quot;function f() { const one = 1; return one = 2; } f();&quot;, &quot;2&quot;);
+
+// PostIncResolveNode
+shouldBe(&quot;one++&quot;, &quot;1&quot;);
+shouldBe(&quot;one&quot;, &quot;1&quot;);
+
+// PostDecResolveNode
+shouldBe(&quot;one--&quot;, &quot;1&quot;);
+shouldBe(&quot;one&quot;, &quot;1&quot;);
+
+// PreIncResolveNode
+shouldBe(&quot;++one&quot;, &quot;2&quot;);
+shouldBe(&quot;one&quot;, &quot;1&quot;);
+
+// PreDecResolveNode
+shouldBe(&quot;--one&quot;, &quot;0&quot;);
+shouldBe(&quot;one&quot;, &quot;1&quot;);
+
+// ReadModifyConstNode
+shouldBe(&quot;one += 1&quot;, &quot;2&quot;);
+shouldBe(&quot;one&quot;, &quot;1&quot;);
+
+// AssignConstNode
+shouldBe(&quot;one = 2&quot;, &quot;2&quot;);
+shouldBe(&quot;one&quot;, &quot;1&quot;);
+
+var object = { inWith1: &quot;RIGHT&quot;, inWith2: &quot;&quot;}
+with (object) {
+    const inWith1 = &quot;WRONG&quot;;
+    const inWith2 = &quot;RIGHT&quot;;
+    inWith2 = &quot;WRONG&quot;;
+}
+shouldBe(&quot;object.inWith1&quot;, &quot;'RIGHT'&quot;);
+shouldBe(&quot;inWith2&quot;, &quot;'RIGHT'&quot;);
+
+shouldBe(&quot;(function(){ one = 2; return one; })()&quot;, &quot;1&quot;)
+var f = function g() { g=&quot;FAIL&quot;; return g; };
+shouldBe(&quot;f()&quot;, &quot;f&quot;);
+
+shouldBe(&quot;const a;&quot;, &quot;undefined&quot;);
+
+// Make sure that dynamic scopes (catch, with) don't break const declarations
+function tryCatch1() {
+    var bar;
+    eval(&quot;try {\
+        stuff();\
+    } catch (e) {\
+        const bar = 5;\
+    }&quot;);
+    return bar;
+}
+
+function tryCatch2() {
+    var bar;
+    try {
+        stuff();
+    } catch (e) {
+        const bar = 5;
+    }
+    return bar;
+}
+
+tryCatch1Result = tryCatch1();
+shouldBe(&quot;tryCatch1Result&quot;, &quot;5&quot;);
+tryCatch2Result = tryCatch2();
+shouldBe(&quot;tryCatch2Result&quot;, &quot;5&quot;);
+
+function with1() {
+    var bar;
+    eval(&quot;with({foo:42}) const bar = 5;&quot;);
+    return bar;
+}
+
+function with2() {
+    var bar;
+    with({foo:42}) const bar = 5;
+    return bar;
+}
+
+with1Result = with1();
+shouldBe(&quot;with1Result&quot;, &quot;5&quot;);
+with2Result = with2();
+shouldBe(&quot;with2Result&quot;, &quot;5&quot;);
+
+(function () {
+    function shouldBe(aDescription, a, b)
+    {
+        if (a === b) {
+            testPassed(&quot;PASS: &quot; + aDescription + &quot; should be &quot; + b + &quot; and is.&quot;);
+            return;
+        }
+
+        testFailed(&quot;FAIL: &quot; + aDescription + &quot; should be &quot; + b + &quot; but instead is &quot; + a + &quot;.&quot;);
+    }
+
+    (function() {
+        const x = &quot;1&quot;;
+        shouldBe(&quot;++x&quot;, ++x, 2);
+        shouldBe(&quot;--x&quot;, --x, 0);
+        shouldBe(&quot;x&quot;, x, &quot;1&quot;);
+        shouldBe(&quot;x++&quot;, x++, 1);
+        shouldBe(&quot;x&quot;, x, &quot;1&quot;);
+    })();
+    (function() {
+        const x = 1;
+        shouldBe(&quot;++x&quot;, ++x, 2);
+        shouldBe(&quot;x&quot;, x, 1);
+        shouldBe(&quot;x++&quot;, x++, 1);
+        shouldBe(&quot;x&quot;, x, 1);
+    })();
+})();
</ins></span></pre>
</div>
</div>

</body>
</html>