Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(840)

Unified Diff: src/accessors.cc

Issue 2081733004: Rip out most of our outdated modules implementation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/accessors.h ('k') | src/ast/ast.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/accessors.cc
diff --git a/src/accessors.cc b/src/accessors.cc
index 74238eb168e832952a608d24f2da66fffcea172d..8f432cd63b1c36fcf8d27dac7161a7500081a65e 100644
--- a/src/accessors.cc
+++ b/src/accessors.cc
@@ -1110,63 +1110,6 @@ Handle<AccessorInfo> Accessors::BoundFunctionNameInfo(
attributes);
}
-//
-// Accessors::MakeModuleExport
-//
-
-static void ModuleGetExport(v8::Local<v8::Name> property,
- const v8::PropertyCallbackInfo<v8::Value>& info) {
- JSModule* instance = JSModule::cast(*v8::Utils::OpenHandle(*info.Holder()));
- Context* context = Context::cast(instance->context());
- DCHECK(context->IsModuleContext());
- Isolate* isolate = instance->GetIsolate();
- int slot = info.Data()
- ->Int32Value(info.GetIsolate()->GetCurrentContext())
- .FromMaybe(-1);
- if (slot < 0 || slot >= context->length()) {
- Handle<Name> name = v8::Utils::OpenHandle(*property);
-
- Handle<Object> exception = isolate->factory()->NewReferenceError(
- MessageTemplate::kNotDefined, name);
- isolate->ScheduleThrow(*exception);
- return;
- }
- Object* value = context->get(slot);
- if (value->IsTheHole(isolate)) {
- Handle<Name> name = v8::Utils::OpenHandle(*property);
-
- Handle<Object> exception = isolate->factory()->NewReferenceError(
- MessageTemplate::kNotDefined, name);
- isolate->ScheduleThrow(*exception);
- return;
- }
- info.GetReturnValue().Set(v8::Utils::ToLocal(Handle<Object>(value, isolate)));
-}
-
-
-static void ModuleSetExport(v8::Local<v8::Name> property,
- v8::Local<v8::Value> value,
- const v8::PropertyCallbackInfo<void>& info) {
- if (!info.ShouldThrowOnError()) return;
- Handle<Name> name = v8::Utils::OpenHandle(*property);
- Isolate* isolate = name->GetIsolate();
- Handle<Object> exception =
- isolate->factory()->NewTypeError(MessageTemplate::kNotDefined, name);
- isolate->ScheduleThrow(*exception);
-}
-
-
-Handle<AccessorInfo> Accessors::MakeModuleExport(
- Handle<String> name,
- int index,
- PropertyAttributes attributes) {
- Isolate* isolate = name->GetIsolate();
- Handle<AccessorInfo> info = MakeAccessor(isolate, name, &ModuleGetExport,
- &ModuleSetExport, attributes);
- info->set_data(Smi::FromInt(index));
- return info;
-}
-
} // namespace internal
} // namespace v8
« no previous file with comments | « src/accessors.h ('k') | src/ast/ast.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698