From d2cfd332ac04f630ab1eb93b71f78a0474f43b88 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Fri, 19 Jul 2019 15:48:48 +0200 Subject: 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` --- js/src/builtin/Utilities.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js') diff --git a/js/src/builtin/Utilities.js b/js/src/builtin/Utilities.js index ec5c88336..d5f233d05 100644 --- a/js/src/builtin/Utilities.js +++ b/js/src/builtin/Utilities.js @@ -254,7 +254,7 @@ function CopyDataProperties(target, source, excluded) { // We abbreviate this by calling propertyIsEnumerable which is faster // 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]); } -- cgit v1.2.3