OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 | 5 |
6 // Defined when linking against shared lib on Windows. | 6 // Defined when linking against shared lib on Windows. |
7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED) | 7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED) |
8 #define V8_SHARED | 8 #define V8_SHARED |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 Isolate* isolate = args.GetIsolate(); | 494 Isolate* isolate = args.GetIsolate(); |
495 PerIsolateData* data = PerIsolateData::Get(isolate); | 495 PerIsolateData* data = PerIsolateData::Get(isolate); |
496 int index = data->RealmIndexOrThrow(args, 0); | 496 int index = data->RealmIndexOrThrow(args, 0); |
497 if (index == -1) return; | 497 if (index == -1) return; |
498 if (index == 0 || | 498 if (index == 0 || |
499 index == data->realm_current_ || index == data->realm_switch_) { | 499 index == data->realm_current_ || index == data->realm_switch_) { |
500 Throw(args.GetIsolate(), "Invalid realm index"); | 500 Throw(args.GetIsolate(), "Invalid realm index"); |
501 return; | 501 return; |
502 } | 502 } |
503 data->realms_[index].Reset(); | 503 data->realms_[index].Reset(); |
| 504 isolate->ContextDisposedNotification(); |
| 505 isolate->IdleNotificationDeadline(g_platform->MonotonicallyIncreasingTime()); |
504 } | 506 } |
505 | 507 |
506 | 508 |
507 // Realm.switch(i) switches to the realm i for consecutive interactive inputs. | 509 // Realm.switch(i) switches to the realm i for consecutive interactive inputs. |
508 void Shell::RealmSwitch(const v8::FunctionCallbackInfo<v8::Value>& args) { | 510 void Shell::RealmSwitch(const v8::FunctionCallbackInfo<v8::Value>& args) { |
509 Isolate* isolate = args.GetIsolate(); | 511 Isolate* isolate = args.GetIsolate(); |
510 PerIsolateData* data = PerIsolateData::Get(isolate); | 512 PerIsolateData* data = PerIsolateData::Get(isolate); |
511 int index = data->RealmIndexOrThrow(args, 0); | 513 int index = data->RealmIndexOrThrow(args, 0); |
512 if (index == -1) return; | 514 if (index == -1) return; |
513 data->realm_switch_ = index; | 515 data->realm_switch_ = index; |
(...skipping 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1746 } | 1748 } |
1747 | 1749 |
1748 } // namespace v8 | 1750 } // namespace v8 |
1749 | 1751 |
1750 | 1752 |
1751 #ifndef GOOGLE3 | 1753 #ifndef GOOGLE3 |
1752 int main(int argc, char* argv[]) { | 1754 int main(int argc, char* argv[]) { |
1753 return v8::Shell::Main(argc, argv); | 1755 return v8::Shell::Main(argc, argv); |
1754 } | 1756 } |
1755 #endif | 1757 #endif |
OLD | NEW |