Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index 5d07cd884a08ef5f0a7aa05526ba7cc3c2caf8e9..95a64a91cfcc15ad5ee6391857fda20119ff60e8 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -5775,80 +5775,6 @@ THREADED_TEST(ExtensibleOnUndetectable) { |
} |
-THREADED_TEST(UndetectableString) { |
- LocalContext env; |
- v8::HandleScope scope(env->GetIsolate()); |
- |
- Local<String> obj = String::NewFromUtf8(env->GetIsolate(), "foo", |
- String::kUndetectableString); |
- env->Global()->Set(v8_str("undetectable"), obj); |
- |
- ExpectString("undetectable", "foo"); |
- ExpectString("typeof undetectable", "undefined"); |
- ExpectString("typeof(undetectable)", "undefined"); |
- ExpectBoolean("typeof undetectable == 'undefined'", true); |
- ExpectBoolean("typeof undetectable == 'string'", false); |
- ExpectBoolean("if (undetectable) { true; } else { false; }", false); |
- ExpectBoolean("!undetectable", true); |
- |
- ExpectObject("true&&undetectable", obj); |
- ExpectBoolean("false&&undetectable", false); |
- ExpectBoolean("true||undetectable", true); |
- ExpectObject("false||undetectable", obj); |
- |
- ExpectObject("undetectable&&true", obj); |
- ExpectObject("undetectable&&false", obj); |
- ExpectBoolean("undetectable||true", true); |
- ExpectBoolean("undetectable||false", false); |
- |
- ExpectBoolean("undetectable==null", true); |
- ExpectBoolean("null==undetectable", true); |
- ExpectBoolean("undetectable==undefined", true); |
- ExpectBoolean("undefined==undetectable", true); |
- ExpectBoolean("undetectable==undetectable", true); |
- |
- |
- ExpectBoolean("undetectable===null", false); |
- ExpectBoolean("null===undetectable", false); |
- ExpectBoolean("undetectable===undefined", false); |
- ExpectBoolean("undefined===undetectable", false); |
- ExpectBoolean("undetectable===undetectable", true); |
-} |
- |
- |
-TEST(UndetectableOptimized) { |
- i::FLAG_allow_natives_syntax = true; |
- LocalContext env; |
- v8::HandleScope scope(env->GetIsolate()); |
- |
- Local<String> obj = String::NewFromUtf8(env->GetIsolate(), "foo", |
- String::kUndetectableString); |
- env->Global()->Set(v8_str("undetectable"), obj); |
- env->Global()->Set(v8_str("detectable"), v8_str("bar")); |
- |
- ExpectString( |
- "function testBranch() {" |
- " if (!%_IsUndetectableObject(undetectable)) throw 1;" |
- " if (%_IsUndetectableObject(detectable)) throw 2;" |
- "}\n" |
- "function testBool() {" |
- " var b1 = !%_IsUndetectableObject(undetectable);" |
- " var b2 = %_IsUndetectableObject(detectable);" |
- " if (b1) throw 3;" |
- " if (b2) throw 4;" |
- " return b1 == b2;" |
- "}\n" |
- "%OptimizeFunctionOnNextCall(testBranch);" |
- "%OptimizeFunctionOnNextCall(testBool);" |
- "for (var i = 0; i < 10; i++) {" |
- " testBranch();" |
- " testBool();" |
- "}\n" |
- "\"PASS\"", |
- "PASS"); |
-} |
- |
- |
// The point of this test is type checking. We run it only so compilers |
// don't complain about an unused function. |
TEST(PersistentHandles) { |