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

Unified Diff: test/mjsunit/harmony/reflect-apply.js

Issue 1219943002: Expose SIMD.Float32x4 type to Javascript. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove SIMD_OBJECT from native context fields. Created 5 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/mjsunit/harmony/reflect-apply.js
diff --git a/test/mjsunit/harmony/reflect-apply.js b/test/mjsunit/harmony/reflect-apply.js
index 2cfb98282bbc21c5ef30f38183acefcb30142f47..3d37354dd90e21b827aba0c5ead1dede7673b6ac 100644
--- a/test/mjsunit/harmony/reflect-apply.js
+++ b/test/mjsunit/harmony/reflect-apply.js
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --harmony-reflect
+// Flags: --harmony-reflect --harmony-simd
rossberg 2015/07/10 11:38:20 This must not be needed, see other comment.
(function testReflectApplyArity() {
@@ -36,6 +36,9 @@
assertSame(Symbol.prototype,
Object.getPrototypeOf(
Reflect.apply(returnThis, Symbol("test"), [])));
+ assertSame(SIMD.float32x4.prototype,
+ Object.getPrototypeOf(
+ Reflect.apply(returnThis, SIMD.float32x4(1, 2, 3, 4), [])));
})();
@@ -50,11 +53,13 @@
// Don't wrap value types
var regexp = /123/;
var symbol = Symbol("test");
+ var float32x4 = SIMD.float32x4(1, 2, 3, 4);
assertSame("str", Reflect.apply(returnThis, "str", []));
assertSame(123, Reflect.apply(returnThis, 123, []));
assertSame(true, Reflect.apply(returnThis, true, []));
assertSame(regexp, Reflect.apply(returnThis, regexp, []));
assertSame(symbol, Reflect.apply(returnThis, symbol, []));
+ assertSame(float32x4, Reflect.apply(returnThis, float32x4, []));
})();
@@ -123,6 +128,8 @@
assertThrows(function() { Reflect.apply(123); }, TypeError);
assertThrows(function() { Reflect.apply("str"); }, TypeError);
assertThrows(function() { Reflect.apply(Symbol("x")); }, TypeError);
+ assertThrows(
+ function() { Reflect.apply(SIMD.float32x4(1, 2, 3, 4)); }, TypeError);
assertThrows(function() { Reflect.apply(/123/); }, TypeError);
assertThrows(function() { Reflect.apply(NaN); }, TypeError);
assertThrows(function() { Reflect.apply({}); }, TypeError);
@@ -136,6 +143,8 @@
assertThrows(function() { Reflect.apply(123); }, TypeError);
assertThrows(function() { Reflect.apply("str"); }, TypeError);
assertThrows(function() { Reflect.apply(Symbol("x")); }, TypeError);
+ assertThrows(
+ function() { Reflect.apply(SIMD.float32x4(1, 2, 3, 4)); }, TypeError);
assertThrows(function() { Reflect.apply(/123/); }, TypeError);
assertThrows(function() { Reflect.apply(NaN); }, TypeError);
assertThrows(function() { Reflect.apply({}); }, TypeError);
@@ -158,6 +167,11 @@
var sym = Symbol("x");
assertThrows(function() { Reflect.apply(noopStrict, R, sym); }, TypeError);
assertThrows(function() { Reflect.apply(noopSloppy, R, sym); }, TypeError);
+ var float32x4 = SIMD.float32x4(1, 2, 3, 4);
+ assertThrows(
+ function() { Reflect.apply(noopStrict, R, float32x4); }, TypeError);
+ assertThrows(
+ function() { Reflect.apply(noopSloppy, R, float32x4); }, TypeError);
})();

Powered by Google App Engine
This is Rietveld 408576698