Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Unified Diff: test/webkit/fast/js/kde/eval.js

Issue 21070002: Migrate more tests from blink repository. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/webkit/fast/js/kde/encode_decode_uri-expected.txt ('k') | test/webkit/fast/js/kde/eval-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/webkit/fast/js/kde/eval.js
diff --git a/test/webkit/array-sort-small-sparse-array-with-large-length.js b/test/webkit/fast/js/kde/eval.js
similarity index 67%
copy from test/webkit/array-sort-small-sparse-array-with-large-length.js
copy to test/webkit/fast/js/kde/eval.js
index 05478d6f8ca2117838ae59702e01ea6d76e19fa7..7c4b5d4b928da31c29772cfb12404dcc4fc782e7 100644
--- a/test/webkit/array-sort-small-sparse-array-with-large-length.js
+++ b/test/webkit/fast/js/kde/eval.js
@@ -21,20 +21,36 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-description(
-"Tests that we can quickly sort a small sparse array that has a large length."
-);
+description("KDE JS Test");
+shouldBe("eval.length", "1");
+shouldBe("eval('this')", "this");
-var array = [];
-array[10000000] = 42;
-array.sort();
-var result = "";
-for (var s in array) {
- debug("array[" + s + "] = " + array[s]);
- if (result)
- result += ",";
- result += array[s];
+function MyObject() {
+ this.x = 99;
}
-shouldBe("result", "\"42\"");
-shouldBe("array.length", "10000001");
-shouldBe("array[0]", "42");
+
+eval("b = new MyObject();");
+var bx = b.x // rule out side effects of eval() in shouldBe() test function
+shouldBe("bx", "99");
+
+
+eval("var c = new MyObject();"); // the 'var' makes a difference
+var cx = c.x;
+shouldBe("cx", "99");
+
+// KDE bug #45679
+if (true.eval) {
+ var o = { str:1 };
+ shouldBe("o.eval('str')", "1");
+ shouldBe("o.eval('this')", "this");
+} else {
+ testPassed("Skipping test for deprecated Object.prototype.eval()");
+}
+
+// problem from within khtml
+function lotto() {
+ // j must be accessible to eval()
+ for (var j = 0; j < 1; j++)
+ return eval('j');
+}
+shouldBe("lotto()", "0");
« no previous file with comments | « test/webkit/fast/js/kde/encode_decode_uri-expected.txt ('k') | test/webkit/fast/js/kde/eval-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698