OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #include "src/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
(...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 bool success; | 920 bool success; |
921 LookupIterator it = LookupIterator::PropertyOrElement( | 921 LookupIterator it = LookupIterator::PropertyOrElement( |
922 isolate, o, key, &success, LookupIterator::OWN); | 922 isolate, o, key, &success, LookupIterator::OWN); |
923 if (!success) return isolate->heap()->exception(); | 923 if (!success) return isolate->heap()->exception(); |
924 MAYBE_RETURN( | 924 MAYBE_RETURN( |
925 JSReceiver::CreateDataProperty(&it, value, Object::THROW_ON_ERROR), | 925 JSReceiver::CreateDataProperty(&it, value, Object::THROW_ON_ERROR), |
926 isolate->heap()->exception()); | 926 isolate->heap()->exception()); |
927 return *value; | 927 return *value; |
928 } | 928 } |
929 | 929 |
| 930 RUNTIME_FUNCTION(Runtime_LoadModuleExport) { |
| 931 HandleScope scope(isolate); |
| 932 DCHECK(args.length() == 1); |
| 933 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); |
| 934 Handle<JSModule> module(isolate->context()->module()); |
| 935 return *JSModule::LoadExport(module, name); |
| 936 } |
| 937 |
| 938 RUNTIME_FUNCTION(Runtime_StoreModuleExport) { |
| 939 HandleScope scope(isolate); |
| 940 DCHECK(args.length() == 2); |
| 941 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); |
| 942 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); |
| 943 Handle<JSModule> module(isolate->context()->module()); |
| 944 JSModule::StoreExport(module, name, value); |
| 945 return isolate->heap()->undefined_value(); |
| 946 } |
| 947 |
930 } // namespace internal | 948 } // namespace internal |
931 } // namespace v8 | 949 } // namespace v8 |
OLD | NEW |