Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index d0b986b796e61f1c2a4e90d9e3fb930e3b2ac881..3036e883009b4cc6e00f8589da9b92185708d122 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -15173,6 +15173,31 @@ THREADED_TEST(Float64Array) { |
v8::kExternalDoubleArray, -500, 500); |
} |
+#define IS_TYPED_ARRAY_TEST(TypedArray) \ |
+ THREADED_TEST(Is##TypedArray) { \ |
+ i::FLAG_harmony_typed_arrays = true; \ |
+ LocalContext env; \ |
+ v8::Isolate* isolate = env->GetIsolate(); \ |
+ v8::HandleScope handle_scope(isolate); \ |
+ \ |
+ Handle<Value> result = CompileRun( \ |
+ "var ab = new ArrayBuffer(128);" \ |
+ "new " #TypedArray "(ab)"); \ |
+ CHECK(result->Is##TypedArray()); \ |
+ } |
+ |
+IS_TYPED_ARRAY_TEST(Uint8Array) |
+IS_TYPED_ARRAY_TEST(Int8Array) |
+IS_TYPED_ARRAY_TEST(Uint16Array) |
+IS_TYPED_ARRAY_TEST(Int16Array) |
+IS_TYPED_ARRAY_TEST(Uint32Array) |
+IS_TYPED_ARRAY_TEST(Int32Array) |
+IS_TYPED_ARRAY_TEST(Float32Array) |
+IS_TYPED_ARRAY_TEST(Float64Array) |
+ |
+#undef IS_TYPED_ARRAY_TEST |
+ |
+ |
THREADED_TEST(ScriptContextDependence) { |
LocalContext c1; |