summaryrefslogtreecommitdiff
path: root/deps/v8/src/keys.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/keys.cc')
-rw-r--r--deps/v8/src/keys.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/deps/v8/src/keys.cc b/deps/v8/src/keys.cc
index 638c83f427..7af093744e 100644
--- a/deps/v8/src/keys.cc
+++ b/deps/v8/src/keys.cc
@@ -6,7 +6,7 @@
#include "src/api-arguments-inl.h"
#include "src/elements.h"
-#include "src/factory.h"
+#include "src/heap/factory.h"
#include "src/identity-map.h"
#include "src/isolate-inl.h"
#include "src/objects-inl.h"
@@ -660,6 +660,16 @@ Maybe<bool> KeyAccumulator::CollectOwnPropertyNames(Handle<JSReceiver> receiver,
enum_keys = GetOwnEnumPropertyDictionaryKeys(
isolate_, mode_, this, object, object->property_dictionary());
}
+ if (object->IsJSModuleNamespace()) {
+ // Simulate [[GetOwnProperty]] for establishing enumerability, which
+ // throws for uninitialized exports.
+ for (int i = 0, n = enum_keys->length(); i < n; ++i) {
+ Handle<String> key(String::cast(enum_keys->get(i)), isolate_);
+ if (Handle<JSModuleNamespace>::cast(object)->GetExport(key).is_null()) {
+ return Nothing<bool>();
+ }
+ }
+ }
AddKeys(enum_keys, DO_NOT_CONVERT);
} else {
if (object->HasFastProperties()) {