Fix order of OwnProperty check for rest parameters.

This was a small mistake when converting from the `hasOwn()` function format (swapped parameters). Fixing this properly makes rest parameters exclude the parameters that are defined (which is the whole point of `...rest`
This commit is contained in:
Moonchild 2019-07-19 15:48:48 +02:00 committed by Roy Tam
commit 41efc528d5

View file

@ -254,7 +254,7 @@ function CopyDataProperties(target, source, excluded) {
// We abbreviate this by calling propertyIsEnumerable which is faster // We abbreviate this by calling propertyIsEnumerable which is faster
// and returns false for not defined properties. // and returns false for not defined properties.
if (!callFunction(std_Object_hasOwnProperty, key, excluded) && callFunction(std_Object_propertyIsEnumerable, source, key)) if (!callFunction(std_Object_hasOwnProperty, excluded, key) && callFunction(std_Object_propertyIsEnumerable, source, key))
_DefineDataProperty(target, key, source[key]); _DefineDataProperty(target, key, source[key]);
} }