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

Unified Diff: test/webkit/fast/js/object-slow-put.js

Issue 20280003: 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
Index: test/webkit/fast/js/object-slow-put.js
diff --git a/test/webkit/dfg-arguments-mixed-alias.js b/test/webkit/fast/js/object-slow-put.js
similarity index 76%
copy from test/webkit/dfg-arguments-mixed-alias.js
copy to test/webkit/fast/js/object-slow-put.js
index 477eac3d5f748c15e2a71f30f5c34b471b89cec4..bf8234f209c68cf992bb8dd3da6312d56fccdfd3 100644
--- a/test/webkit/dfg-arguments-mixed-alias.js
+++ b/test/webkit/fast/js/object-slow-put.js
@@ -22,21 +22,24 @@
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
-"Tests functions that use 'arguments' in both an aliased and a non-aliased way."
+"Tests that defining a setter on the prototype of an object used for indexed storage works."
);
-function foo() {
- var result = 0;
- var a = arguments;
- for (var i = 0; i < a.length; ++i)
- result += arguments[i];
- return result;
+function Cons() {
}
-function bar(x) {
- return foo(x);
+var ouches = 0;
+Cons.prototype.__defineSetter__("3", function() { debug("Ouch!"); ouches++; });
+
+function foo() {
+ var result = new Cons();
+ result.length = 5;
+ for (var i = 0; i < result.length; ++i)
+ result[i] = i;
+ return result;
}
-for (var i = 0; i < 200; ++i)
- shouldBe("bar(42)", "42");
+for (var i = 0; i < 100; ++i)
+ shouldBe("\"" + Array.prototype.join.apply(foo(), [","]) + "\"", "\"0,1,2,,4\"");
+shouldBe("ouches", "100");
« no previous file with comments | « test/webkit/fast/js/object-prototype-toLocaleString-expected.txt ('k') | test/webkit/fast/js/object-slow-put-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698