| Index: test/cctest/test-decls.cc
|
| diff --git a/test/cctest/test-decls.cc b/test/cctest/test-decls.cc
|
| index 1f22c9ff3a0eb1b5efe9aaa4e8bcf9173bccb29c..6ae23f29286a16e88e47e283dffb4e988371a8f8 100644
|
| --- a/test/cctest/test-decls.cc
|
| +++ b/test/cctest/test-decls.cc
|
| @@ -96,8 +96,6 @@ class DeclarationContext {
|
| static void HandleQuery(Local<String> key,
|
| const v8::PropertyCallbackInfo<v8::Integer>& info);
|
|
|
| - v8::Isolate* isolate() const { return CcTest::isolate(); }
|
| -
|
| private:
|
| bool is_initialized_;
|
| Persistent<Context> context_;
|
| @@ -246,7 +244,7 @@ TEST(Unknown) {
|
| 1, // access
|
| 2, // declaration + initialization
|
| 2, // declaration + initialization
|
| - EXPECT_RESULT, Number::New(CcTest::isolate(), 0));
|
| + EXPECT_RESULT, Number::New(0));
|
| }
|
|
|
| { DeclarationContext context;
|
| @@ -280,7 +278,7 @@ TEST(Unknown) {
|
| class PresentPropertyContext: public DeclarationContext {
|
| protected:
|
| virtual v8::Handle<Integer> Query(Local<String> key) {
|
| - return Integer::New(isolate(), v8::None);
|
| + return Integer::New(v8::None);
|
| }
|
| };
|
|
|
| @@ -302,7 +300,7 @@ TEST(Present) {
|
| 1, // access
|
| 1, // initialization
|
| 2, // declaration + initialization
|
| - EXPECT_RESULT, Number::New(CcTest::isolate(), 0));
|
| + EXPECT_RESULT, Number::New(0));
|
| }
|
|
|
| { PresentPropertyContext context;
|
| @@ -326,7 +324,7 @@ TEST(Present) {
|
| 1, // access
|
| 1, // initialization
|
| 1, // (re-)declaration
|
| - EXPECT_RESULT, Number::New(CcTest::isolate(), 0));
|
| + EXPECT_RESULT, Number::New(0));
|
| }
|
| }
|
|
|
| @@ -358,7 +356,7 @@ TEST(Absent) {
|
| 1, // access
|
| 2, // declaration + initialization
|
| 2, // declaration + initialization
|
| - EXPECT_RESULT, Number::New(isolate, 0));
|
| + EXPECT_RESULT, Number::New(0));
|
| }
|
|
|
| { AbsentPropertyContext context;
|
| @@ -418,7 +416,7 @@ class AppearingPropertyContext: public DeclarationContext {
|
| // Return that the property is present so we only get the
|
| // setter called when initializing with a value.
|
| state_ = UNKNOWN;
|
| - return Integer::New(isolate(), v8::None);
|
| + return Integer::New(v8::None);
|
| default:
|
| CHECK(state_ == UNKNOWN);
|
| break;
|
| @@ -449,7 +447,7 @@ TEST(Appearing) {
|
| 1, // access
|
| 2, // declaration + initialization
|
| 2, // declaration + initialization
|
| - EXPECT_RESULT, Number::New(CcTest::isolate(), 0));
|
| + EXPECT_RESULT, Number::New(0));
|
| }
|
|
|
| { AppearingPropertyContext context;
|
| @@ -504,7 +502,7 @@ class ReappearingPropertyContext: public DeclarationContext {
|
| // Ignore the second declaration by returning
|
| // that the property is already there.
|
| state_ = INITIALIZE;
|
| - return Integer::New(isolate(), v8::None);
|
| + return Integer::New(v8::None);
|
| case INITIALIZE:
|
| // Force an initialization by returning that
|
| // the property is absent. This will make sure
|
| @@ -541,12 +539,10 @@ TEST(Reappearing) {
|
|
|
|
|
| class ExistsInPrototypeContext: public DeclarationContext {
|
| - public:
|
| - ExistsInPrototypeContext() { InitializeIfNeeded(); }
|
| protected:
|
| virtual v8::Handle<Integer> Query(Local<String> key) {
|
| // Let it seem that the property exists in the prototype object.
|
| - return Integer::New(isolate(), v8::None);
|
| + return Integer::New(v8::None);
|
| }
|
|
|
| // Use the prototype as the holder for the interceptors.
|
| @@ -567,7 +563,7 @@ TEST(ExistsInPrototype) {
|
| 0,
|
| 0,
|
| 0,
|
| - EXPECT_RESULT, Number::New(CcTest::isolate(), 87));
|
| + EXPECT_RESULT, Number::New(87));
|
| }
|
|
|
| { ExistsInPrototypeContext context;
|
| @@ -583,7 +579,7 @@ TEST(ExistsInPrototype) {
|
| 0,
|
| 0,
|
| 0,
|
| - EXPECT_RESULT, Number::New(CcTest::isolate(), 0));
|
| + EXPECT_RESULT, Number::New(0));
|
| }
|
|
|
| { ExistsInPrototypeContext context;
|
| @@ -599,7 +595,7 @@ TEST(ExistsInPrototype) {
|
| 0,
|
| 0,
|
| 0,
|
| - EXPECT_RESULT, Number::New(CcTest::isolate(), 0));
|
| + EXPECT_RESULT, Number::New(0));
|
| }
|
| }
|
|
|
| @@ -645,7 +641,7 @@ class ExistsInHiddenPrototypeContext: public DeclarationContext {
|
| protected:
|
| virtual v8::Handle<Integer> Query(Local<String> key) {
|
| // Let it seem that the property exists in the hidden prototype object.
|
| - return Integer::New(isolate(), v8::None);
|
| + return Integer::New(v8::None);
|
| }
|
|
|
| // Install the hidden prototype after the global object has been created.
|
| @@ -684,7 +680,7 @@ TEST(ExistsInHiddenPrototype) {
|
| 1, // access
|
| 1, // initialization
|
| 2, // declaration + initialization
|
| - EXPECT_RESULT, Number::New(CcTest::isolate(), 0));
|
| + EXPECT_RESULT, Number::New(0));
|
| }
|
|
|
| { ExistsInHiddenPrototypeContext context;
|
| @@ -710,7 +706,7 @@ TEST(ExistsInHiddenPrototype) {
|
| 0,
|
| 0,
|
| 1, // (re-)declaration
|
| - EXPECT_RESULT, Number::New(CcTest::isolate(), 0));
|
| + EXPECT_RESULT, Number::New(0));
|
| }
|
| }
|
|
|
| @@ -763,41 +759,40 @@ class SimpleContext {
|
|
|
|
|
| TEST(CrossScriptReferences) {
|
| - v8::Isolate* isolate = CcTest::isolate();
|
| - HandleScope scope(isolate);
|
| + HandleScope scope(CcTest::isolate());
|
|
|
| { SimpleContext context;
|
| context.Check("var x = 1; x",
|
| - EXPECT_RESULT, Number::New(isolate, 1));
|
| + EXPECT_RESULT, Number::New(1));
|
| context.Check("var x = 2; x",
|
| - EXPECT_RESULT, Number::New(isolate, 2));
|
| + EXPECT_RESULT, Number::New(2));
|
| context.Check("const x = 3; x",
|
| - EXPECT_RESULT, Number::New(isolate, 3));
|
| + EXPECT_RESULT, Number::New(3));
|
| context.Check("const x = 4; x",
|
| - EXPECT_RESULT, Number::New(isolate, 4));
|
| + EXPECT_RESULT, Number::New(4));
|
| context.Check("x = 5; x",
|
| - EXPECT_RESULT, Number::New(isolate, 5));
|
| + EXPECT_RESULT, Number::New(5));
|
| context.Check("var x = 6; x",
|
| - EXPECT_RESULT, Number::New(isolate, 6));
|
| + EXPECT_RESULT, Number::New(6));
|
| context.Check("this.x",
|
| - EXPECT_RESULT, Number::New(isolate, 6));
|
| + EXPECT_RESULT, Number::New(6));
|
| context.Check("function x() { return 7 }; x()",
|
| - EXPECT_RESULT, Number::New(isolate, 7));
|
| + EXPECT_RESULT, Number::New(7));
|
| }
|
|
|
| { SimpleContext context;
|
| context.Check("const x = 1; x",
|
| - EXPECT_RESULT, Number::New(isolate, 1));
|
| + EXPECT_RESULT, Number::New(1));
|
| context.Check("var x = 2; x", // assignment ignored
|
| - EXPECT_RESULT, Number::New(isolate, 1));
|
| + EXPECT_RESULT, Number::New(1));
|
| context.Check("const x = 3; x",
|
| - EXPECT_RESULT, Number::New(isolate, 1));
|
| + EXPECT_RESULT, Number::New(1));
|
| context.Check("x = 4; x", // assignment ignored
|
| - EXPECT_RESULT, Number::New(isolate, 1));
|
| + EXPECT_RESULT, Number::New(1));
|
| context.Check("var x = 5; x", // assignment ignored
|
| - EXPECT_RESULT, Number::New(isolate, 1));
|
| + EXPECT_RESULT, Number::New(1));
|
| context.Check("this.x",
|
| - EXPECT_RESULT, Number::New(isolate, 1));
|
| + EXPECT_RESULT, Number::New(1));
|
| context.Check("function x() { return 7 }; x",
|
| EXPECT_EXCEPTION);
|
| }
|
| @@ -809,8 +804,7 @@ TEST(CrossScriptReferencesHarmony) {
|
| i::FLAG_harmony_scoping = true;
|
| i::FLAG_harmony_modules = true;
|
|
|
| - v8::Isolate* isolate = CcTest::isolate();
|
| - HandleScope scope(isolate);
|
| + HandleScope scope(CcTest::isolate());
|
|
|
| const char* decs[] = {
|
| "var x = 1; x", "x", "this.x",
|
| @@ -823,14 +817,12 @@ TEST(CrossScriptReferencesHarmony) {
|
|
|
| for (int i = 0; decs[i] != NULL; i += 3) {
|
| SimpleContext context;
|
| - context.Check(decs[i], EXPECT_RESULT, Number::New(isolate, 1));
|
| - context.Check(decs[i+1], EXPECT_RESULT, Number::New(isolate, 1));
|
| + context.Check(decs[i], EXPECT_RESULT, Number::New(1));
|
| + context.Check(decs[i+1], EXPECT_RESULT, Number::New(1));
|
| // TODO(rossberg): The current ES6 draft spec does not reflect lexical
|
| // bindings on the global object. However, this will probably change, in
|
| // which case we reactivate the following test.
|
| - if (i/3 < 2) {
|
| - context.Check(decs[i+2], EXPECT_RESULT, Number::New(isolate, 1));
|
| - }
|
| + if (i/3 < 2) context.Check(decs[i+2], EXPECT_RESULT, Number::New(1));
|
| }
|
| }
|
|
|
| @@ -862,14 +854,12 @@ TEST(CrossScriptConflicts) {
|
| for (int i = 0; firsts[i] != NULL; ++i) {
|
| for (int j = 0; seconds[j] != NULL; ++j) {
|
| SimpleContext context;
|
| - context.Check(firsts[i], EXPECT_RESULT,
|
| - Number::New(CcTest::isolate(), 1));
|
| + context.Check(firsts[i], EXPECT_RESULT, Number::New(1));
|
| // TODO(rossberg): All tests should actually be errors in Harmony,
|
| // but we currently do not detect the cases where the first declaration
|
| // is not lexical.
|
| context.Check(seconds[j],
|
| - i < 2 ? EXPECT_RESULT : EXPECT_ERROR,
|
| - Number::New(CcTest::isolate(), 2));
|
| + i < 2 ? EXPECT_RESULT : EXPECT_ERROR, Number::New(2));
|
| }
|
| }
|
| }
|
|
|