<!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>[175729] 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/175729">175729</a></dd>
<dt>Author</dt> <dd>mark.lam@apple.com</dd>
<dt>Date</dt> <dd>2014-11-06 16:49:36 -0800 (Thu, 06 Nov 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Refactor the get-by-pname.js test [follow up].
<https://webkit.org/b/138483>
Reviewed by Michael Saboff.
Used named properties to make the test code more readable.
* js/script-tests/get-by-pname.js:
(isTierIteration):
(tierName):
(testExpr): Deleted.
(testExpectedResult): Deleted.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsjsscripttestsgetbypnamejs">trunk/LayoutTests/js/script-tests/get-by-pname.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (175728 => 175729)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-11-07 00:34:29 UTC (rev 175728)
+++ trunk/LayoutTests/ChangeLog        2014-11-07 00:49:36 UTC (rev 175729)
</span><span class="lines">@@ -1,5 +1,20 @@
</span><span class="cx"> 2014-11-06 Mark Lam <mark.lam@apple.com>
</span><span class="cx">
</span><ins>+ Refactor the get-by-pname.js test [follow up].
+ <https://webkit.org/b/138483>
+
+ Reviewed by Michael Saboff.
+
+ Used named properties to make the test code more readable.
+
+ * js/script-tests/get-by-pname.js:
+ (isTierIteration):
+ (tierName):
+ (testExpr): Deleted.
+ (testExpectedResult): Deleted.
+
+2014-11-06 Mark Lam <mark.lam@apple.com>
+
</ins><span class="cx"> slow_path_get_direct_pname() needs to be hardened against a constant baseValue.
</span><span class="cx"> <https://webkit.org/b/138476>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsjsscripttestsgetbypnamejs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/js/script-tests/get-by-pname.js (175728 => 175729)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/get-by-pname.js        2014-11-07 00:34:29 UTC (rev 175728)
+++ trunk/LayoutTests/js/script-tests/get-by-pname.js        2014-11-07 00:49:36 UTC (rev 175729)
</span><span class="lines">@@ -33,70 +33,63 @@
</span><span class="cx"> var o1 = {"1":1, "2":3, "3":7};
</span><span class="cx">
</span><span class="cx"> var testCases = [
</span><del>- [ "foo(o)", "11" ],
- [ "foo(p)", "10" ],
- [ "foo(q)", "3467" ],
- [ "foo(r)", "113" ],
- [ "foo(s)", "182" ],
</del><ins>+ { test: "foo(o)", result: "11" },
+ { test: "foo(p)", result: "10" },
+ { test: "foo(q)", result: "3467" },
+ { test: "foo(r)", result: "113" },
+ { test: "foo(s)", result: "182" },
</ins><span class="cx">
</span><del>- [ "getByPnameOnConstant(a)", "0" ],
- [ "getByPnameOnVar(a, 100)", "0" ],
- [ "getByPnameOnVar(a, 'abc')", "'0abc'" ],
- [ "getByPnameOnVar(a, o)", "0" ],
- [ "getByPnameOnVar(a, o1)", "4" ],
- [ "getByPnameOnVar(a, a)", "6" ],
</del><ins>+ { test: "getByPnameOnConstant(a)", result: "0" },
+ { test: "getByPnameOnVar(a, 100)", result: "0" },
+ { test: "getByPnameOnVar(a, 'abc')", result: "'0abc'" },
+ { test: "getByPnameOnVar(a, o)", result: "0" },
+ { test: "getByPnameOnVar(a, o1)", result: "4" },
+ { test: "getByPnameOnVar(a, a)", result: "6" },
</ins><span class="cx">
</span><del>- [ "getByPnameOnConstant(o1)", "0" ],
- [ "getByPnameOnVar(o1, 100)", "0" ],
- [ "getByPnameOnVar(o1, 'abc')", "'0bc0'" ],
- [ "getByPnameOnVar(o1, o)", "0" ],
- [ "getByPnameOnVar(o1, o1)", "11" ],
- [ "getByPnameOnVar(o1, a)", "5" ],
</del><ins>+ { test: "getByPnameOnConstant(o1)", result: "0" },
+ { test: "getByPnameOnVar(o1, 100)", result: "0" },
+ { test: "getByPnameOnVar(o1, 'abc')", result: "'0bc0'" },
+ { test: "getByPnameOnVar(o1, o)", result: "0" },
+ { test: "getByPnameOnVar(o1, o1)", result: "11" },
+ { test: "getByPnameOnVar(o1, a)", result: "5" },
</ins><span class="cx">
</span><del>- [ "getByPnameOnConstant(o)", "0" ],
- [ "getByPnameOnVar(o, 100)", "0" ],
- [ "getByPnameOnVar(o, 'abc')", "0" ],
- [ "getByPnameOnVar(o, o)", "11" ],
- [ "getByPnameOnVar(o, o1)", "0" ],
- [ "getByPnameOnVar(o, a)", "0" ],
</del><ins>+ { test: "getByPnameOnConstant(o)", result: "0" },
+ { test: "getByPnameOnVar(o, 100)", result: "0" },
+ { test: "getByPnameOnVar(o, 'abc')", result: "0" },
+ { test: "getByPnameOnVar(o, o)", result: "11" },
+ { test: "getByPnameOnVar(o, o1)", result: "0" },
+ { test: "getByPnameOnVar(o, a)", result: "0" },
</ins><span class="cx">
</span><del>- [ "getByPnameOnConstant(0)", "0" ],
- [ "getByPnameOnVar(0, 100)", "0" ],
- [ "getByPnameOnVar(0, 'abc')", "0" ],
- [ "getByPnameOnVar(0, o)", "0" ],
- [ "getByPnameOnVar(0, o1)", "0" ],
- [ "getByPnameOnVar(0, a)", "0" ],
</del><ins>+ { test: "getByPnameOnConstant(0)", result: "0" },
+ { test: "getByPnameOnVar(0, 100)", result: "0" },
+ { test: "getByPnameOnVar(0, 'abc')", result: "0" },
+ { test: "getByPnameOnVar(0, o)", result: "0" },
+ { test: "getByPnameOnVar(0, o1)", result: "0" },
+ { test: "getByPnameOnVar(0, a)", result: "0" },
</ins><span class="cx">
</span><del>- [ "getByPnameOnConstant('abc')", "0" ],
- [ "getByPnameOnVar('abc', 100)", "0" ],
- [ "getByPnameOnVar('abc', 'abc')", "'0abc'" ],
- [ "getByPnameOnVar('abc', o)", "0" ],
- [ "getByPnameOnVar('abc', o1)", "4" ],
- [ "getByPnameOnVar('abc', a)", "6" ],
- [ "getByPnameOnVar('def', 'abc')", "'0abc'" ],
</del><ins>+ { test: "getByPnameOnConstant('abc')", result: "0" },
+ { test: "getByPnameOnVar('abc', 100)", result: "0" },
+ { test: "getByPnameOnVar('abc', 'abc')", result: "'0abc'" },
+ { test: "getByPnameOnVar('abc', o)", result: "0" },
+ { test: "getByPnameOnVar('abc', o1)", result: "4" },
+ { test: "getByPnameOnVar('abc', a)", result: "6" },
+ { test: "getByPnameOnVar('def', 'abc')", result: "'0abc'" },
</ins><span class="cx"> ];
</span><span class="cx">
</span><del>-function testExpr(index) {
- return testCases[index][0];
-}
-function testExpectedResult(index) {
- return testCases[index][1];
-}
-
</del><span class="cx"> // The tiers should be sorted from lowest iterations to highest.
</span><span class="cx"> var tiers = [
</span><span class="cx"> // name, iterations
</span><del>- [ "cold", 0 ],
- [ "llint", 10 ],
- [ "baseline", 500 ],
- [ "dfg", 1000 ],
- // [ "ftl", 100000 ],
</del><ins>+ { name: "cold", iterations: 0 },
+ { name: "llint", iterations: 10 },
+ { name: "baseline", iterations: 500 },
+ { name: "dfg", iterations: 1000 },
+ // { name: "ftl", iterations: 100000 },
</ins><span class="cx"> ];
</span><del>-var highestIteration = tiers[tiers.length - 1][1];
</del><ins>+var highestIteration = tiers[tiers.length - 1].iterations;
</ins><span class="cx">
</span><span class="cx"> function isTierIteration(iteration) {
</span><span class="cx"> for (var i = 0; i < tiers.length; i++) {
</span><del>- var tierIteration = tiers[i][1];
</del><ins>+ var tierIteration = tiers[i].iterations;
</ins><span class="cx"> if (iteration < tierIteration)
</span><span class="cx"> return false;
</span><span class="cx"> if (iteration == tierIteration)
</span><span class="lines">@@ -106,8 +99,8 @@
</span><span class="cx"> }
</span><span class="cx"> function tierName(iteration) {
</span><span class="cx"> for (var i = 0; i < tiers.length; i++) {
</span><del>- if (iteration == tiers[i][1])
- return tiers[i][0];
</del><ins>+ if (iteration == tiers[i].iterations)
+ return tiers[i].name;
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -115,11 +108,11 @@
</span><span class="cx"> if (isTierIteration(i)) {
</span><span class="cx"> debug("Test tier: " + tierName(i));
</span><span class="cx"> for (var j = 0; j < testCases.length; j++)
</span><del>- shouldBe(testExpr(j), testExpectedResult(j));
</del><ins>+ shouldBe(testCases[j].test, testCases[j].result);
</ins><span class="cx"> debug("");
</span><span class="cx"> } else {
</span><span class="cx"> for (var j = 0; j < testCases.length; j++)
</span><del>- eval(testExpr(j));
</del><ins>+ eval(testCases[j].test);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>