Index: src/runtime/runtime-object.cc |
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc |
index 9c675d0ce61f7d9c96de1b5d92474dab1d000d6e..1d7c6fedac253aa35b152edc8dcfa4d47bb44f1f 100644 |
--- a/src/runtime/runtime-object.cc |
+++ b/src/runtime/runtime-object.cc |
@@ -771,9 +771,20 @@ RUNTIME_FUNCTION(Runtime_CopyDataPropertiesWithExcludedProperties) { |
return isolate->heap()->undefined_value(); |
} |
- ScopedVector<Handle<Name>> excluded_properties(args.length() - 1); |
+ ScopedVector<Handle<Object>> excluded_properties(args.length() - 1); |
for (int i = 1; i < args.length(); i++) { |
- excluded_properties[i - 1] = args.at<Name>(i); |
+ Handle<Object> property = args.at(i); |
+ uint32_t property_num; |
+ // We convert string to number if possible, in cases of computed |
+ // properties resolving to numbers, which would've been strings |
+ // instead because of our call to %ToName() in the desugaring for |
+ // computed properties. |
+ if (property->IsString() && |
+ String::cast(*property)->AsArrayIndex(&property_num)) { |
+ property = isolate->factory()->NewNumberFromUint(property_num); |
+ } |
+ |
+ excluded_properties[i - 1] = property; |
} |
Handle<JSObject> target = |