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

Unified Diff: test/mjsunit/external-array.js

Issue 6903060: Version 3.3.2.... (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: '' Created 9 years, 8 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/mjsunit/array-functions-prototype-misc.js ('k') | test/mjsunit/global-load-from-eval-in-with.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/external-array.js
===================================================================
--- test/mjsunit/external-array.js (revision 7683)
+++ test/mjsunit/external-array.js (working copy)
@@ -63,3 +63,28 @@
a = new Int16Array(2);
assertEquals(2, a.BYTES_PER_ELEMENT);
+// Test Float64Arrays.
+function get(a, index) {
+ return a[index];
+}
+function set(a, index, value) {
+ a[index] = value;
+}
+
+var array = new Float64Array(2);
+for (var i = 0; i < 5; i++) {
+ set(array, 0, 2.5);
+ assertEquals(2.5, array[0]);
+}
+%OptimizeFunctionOnNextCall(set);
+set(array, 0, 2.5);
+assertEquals(2.5, array[0]);
+set(array, 1, 3.5);
+assertEquals(3.5, array[1]);
+for (var i = 0; i < 5; i++) {
+ assertEquals(2.5, get(array, 0));
+ assertEquals(3.5, array[1]);
+}
+%OptimizeFunctionOnNextCall(get);
+assertEquals(2.5, get(array, 0));
+assertEquals(3.5, get(array, 1));
« no previous file with comments | « test/mjsunit/array-functions-prototype-misc.js ('k') | test/mjsunit/global-load-from-eval-in-with.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698