| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 #include "cctest.h" | 30 #include "cctest.h" |
| 31 | 31 |
| 32 using namespace v8; | 32 using namespace v8; |
| 33 namespace i = v8::internal; | 33 namespace i = v8::internal; |
| 34 | 34 |
| 35 namespace { | 35 namespace { |
| 36 class HarmonyIsolate { | 36 class HarmonyIsolate { |
| 37 public: | 37 public: |
| 38 HarmonyIsolate() { | 38 HarmonyIsolate() { |
| 39 i::FLAG_harmony_promises = true; |
| 39 isolate_ = Isolate::New(); | 40 isolate_ = Isolate::New(); |
| 40 isolate_->Enter(); | 41 isolate_->Enter(); |
| 41 } | 42 } |
| 42 | 43 |
| 43 ~HarmonyIsolate() { | 44 ~HarmonyIsolate() { |
| 44 isolate_->Exit(); | 45 isolate_->Exit(); |
| 45 isolate_->Dispose(); | 46 isolate_->Dispose(); |
| 46 } | 47 } |
| 47 | 48 |
| 48 Isolate* GetIsolate() const { return isolate_; } | 49 Isolate* GetIsolate() const { return isolate_; } |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 "foo.id++;"); | 127 "foo.id++;"); |
| 127 } | 128 } |
| 128 { | 129 { |
| 129 LocalContext context4(isolate.GetIsolate()); | 130 LocalContext context4(isolate.GetIsolate()); |
| 130 context4->Global()->Set(String::NewFromUtf8(isolate.GetIsolate(), "obj"), | 131 context4->Global()->Set(String::NewFromUtf8(isolate.GetIsolate(), "obj"), |
| 131 obj); | 132 obj); |
| 132 V8::RunMicrotasks(isolate.GetIsolate()); | 133 V8::RunMicrotasks(isolate.GetIsolate()); |
| 133 CHECK_EQ(2, CompileRun("obj.calls")->Int32Value()); | 134 CHECK_EQ(2, CompileRun("obj.calls")->Int32Value()); |
| 134 } | 135 } |
| 135 } | 136 } |
| OLD | NEW |