Commit c7c3a535 authored by ggaren@apple.com's avatar ggaren@apple.com

Rubber-stamped by Oliver Hunt.

        
        Landing a few layout tests from http://bugs.webkit.org/show_bug.cgi?id=14868
        Import variable lookup optimizations from KJS

        * fast/js/kde/func-decl-expected.txt: Added.
        * fast/js/kde/func-decl.html: Added.
        * fast/js/kde/resources/func-decl.js: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27724 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 575ca08a
2007-11-12 Geoffrey Garen <ggaren@apple.com>
Rubber-stamped by Oliver Hunt.
Landing a few layout tests from http://bugs.webkit.org/show_bug.cgi?id=14868
Import variable lookup optimizations from KJS
* fast/js/kde/func-decl-expected.txt: Added.
* fast/js/kde/func-decl.html: Added.
* fast/js/kde/resources/func-decl.js: Added.
2007-11-12 Geoffrey Garen <ggaren@apple.com>
Rubber-stamped by Oliver Hunt.
......
KDE JS Test
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS Function declaration takes effect at entry
PASS Decl not yet overwritten
PASS After assign (0)
PASS function decls have no execution content
PASS After assign #2 (0)
PASS Decl already overwritten
PASS After assign (1)
PASS function decls have no execution content
PASS After assign #2 (1)
PASS Decl already overwritten
PASS After assign (2)
PASS function decls have no execution content
PASS After assign #2 (2)
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../resources/js-test-style.css">
<script src="../resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description("KDE JS Test");
</script>
<script src="resources/func-decl.js"></script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>
// We can't use normal shouldBe here, since they'd eval in the wrong context...
function shouldBeOfType(msg, val, type) {
if (typeof(val) != type)
testFailed(msg + ": value has type " + typeof(val) + " , not:" + type);
else
testPassed(msg);
}
function shouldBeVal(msg, val, expected) {
if (val != expected)
testFailed(msg + ": value is " + val + " , not:" + expected);
else
testPassed(msg);
}
f = "global";
function test() {
try {
shouldBeOfType("Function declaration takes effect at entry", f, "function");
}
catch (e) {
testFailed("Scoping very broken!");
}
for (var i = 0; i < 3; ++i) {
if (i == 0)
shouldBeOfType("Decl not yet overwritten", f, 'function');
else
shouldBeOfType("Decl already overwritten", f, 'number');
f = 3;
shouldBeVal("After assign ("+i+")", f, 3);
function f() {};
shouldBeVal("function decls have no execution content", f, 3);
f = 5;
shouldBeVal("After assign #2 ("+i+")", f, 5);
}
}
test();
var successfullyParsed = true;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment