Index: src/runtime/runtime-object.cc |
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc |
index d1e57c00dd93577db40e91c9bcd8bc0ab086c896..0c3e1069db9edf41b5358528a71f964ba11ad21a 100644 |
--- a/src/runtime/runtime-object.cc |
+++ b/src/runtime/runtime-object.cc |
@@ -768,7 +768,7 @@ RUNTIME_FUNCTION(Runtime_DefineGetterPropertyUnchecked) { |
RUNTIME_FUNCTION(Runtime_CopyDataProperties) { |
HandleScope scope(isolate); |
- DCHECK(args.length() == 2); |
+ DCHECK_EQ(2, args.length()); |
CONVERT_ARG_HANDLE_CHECKED(JSObject, target, 0); |
CONVERT_ARG_HANDLE_CHECKED(Object, source, 1); |
@@ -777,12 +777,32 @@ RUNTIME_FUNCTION(Runtime_CopyDataProperties) { |
return isolate->heap()->undefined_value(); |
} |
- MAYBE_RETURN( |
- JSReceiver::SetOrCopyDataProperties(isolate, target, source, false), |
- isolate->heap()->exception()); |
+ MAYBE_RETURN(JSReceiver::SetOrCopyDataProperties(isolate, target, source, |
+ nullptr, false), |
+ isolate->heap()->exception()); |
return isolate->heap()->undefined_value(); |
} |
+RUNTIME_FUNCTION(Runtime_CopyDataPropertiesWithExcludedProperties) { |
+ HandleScope scope(isolate); |
+ DCHECK_LE(1, args.length()); |
+ CONVERT_ARG_HANDLE_CHECKED(Object, source, 0); |
+ |
+ Arguments excluded_properties(1, args.arguments() - 1); |
adamk
2017/01/12 22:43:08
Passing 1 for length here seems wrong, how does th
gsathya
2017/01/17 19:28:59
Done.
|
+ |
+ // 2. If source is undefined or null, let keys be an empty List. |
+ if (source->IsUndefined(isolate) || source->IsNull(isolate)) { |
+ return isolate->heap()->undefined_value(); |
+ } |
+ |
+ Handle<JSObject> target = |
+ isolate->factory()->NewJSObject(isolate->object_function()); |
+ MAYBE_RETURN(JSReceiver::SetOrCopyDataProperties(isolate, target, source, |
+ &excluded_properties, false), |
+ isolate->heap()->exception()); |
+ return *target; |
+} |
+ |
RUNTIME_FUNCTION(Runtime_DefineSetterPropertyUnchecked) { |
HandleScope scope(isolate); |
DCHECK_EQ(4, args.length()); |