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 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 bool success; | 921 bool success; |
922 LookupIterator it = LookupIterator::PropertyOrElement( | 922 LookupIterator it = LookupIterator::PropertyOrElement( |
923 isolate, o, key, &success, LookupIterator::OWN); | 923 isolate, o, key, &success, LookupIterator::OWN); |
924 if (!success) return isolate->heap()->exception(); | 924 if (!success) return isolate->heap()->exception(); |
925 MAYBE_RETURN( | 925 MAYBE_RETURN( |
926 JSReceiver::CreateDataProperty(&it, value, Object::THROW_ON_ERROR), | 926 JSReceiver::CreateDataProperty(&it, value, Object::THROW_ON_ERROR), |
927 isolate->heap()->exception()); | 927 isolate->heap()->exception()); |
928 return *value; | 928 return *value; |
929 } | 929 } |
930 | 930 |
931 RUNTIME_FUNCTION(Runtime_LoadModuleExport) { | |
932 HandleScope scope(isolate); | |
933 DCHECK(args.length() == 1); | |
934 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); | |
935 Handle<JSModule> module(isolate->context()->module()); | |
936 return *JSModule::LoadExport(module, name); | |
937 } | |
938 | |
939 RUNTIME_FUNCTION(Runtime_StoreModuleExport) { | |
940 HandleScope scope(isolate); | |
941 DCHECK(args.length() == 2); | |
942 CONVERT_ARG_HANDLE_CHECKED(String, name, 0); | |
943 CONVERT_ARG_HANDLE_CHECKED(Object, value, 1); | |
944 Handle<JSModule> module(isolate->context()->module()); | |
945 JSModule::StoreExport(module, name, value); | |
946 return isolate->heap()->undefined_value(); | |
947 } | |
948 | |
949 } // namespace internal | 931 } // namespace internal |
950 } // namespace v8 | 932 } // namespace v8 |
OLD | NEW |