From c7429c73ac0119380e9f351e60fdd9ef33082314 Mon Sep 17 00:00:00 2001 From: Doug Ilijev Date: Fri, 9 Feb 2018 03:07:32 -0800 Subject: [PATCH] deps: update ChakraCore to Microsoft/ChakraCore@aec9a9c70a [1.8>1.9] [MERGE #4651 @dilijev] OS#14101048: Fixes #249: built-in functions should not have caller/arguments (and related fixes) Merge pull request #4651 from dilijev:func-restricted-props Replaces #4639 Several tests and test baselines needed to be updated to reflect the change in behavior. This change improves caller/arguments behavior without regressing any previous Chakra behavior. Chakra still differs from the spec and other engines on some aspects of caller/arguments. See: https://tc39.github.io/ecma262/#sec-forbidden-extensions Fixes #249 Fixes OS#14101048 --- Test262 results strictly improved. Using test262 commit https://github.com/tc39/test262/commit/03da22868a3e0b9ecdee4a5d754c72df93baf995: Previously 44130 passed, now 44138 passed out of 57102. (Duplicates below are strict and non-strict versions of the tests.) ``` +PASS e:/dd/test262/test262/test/built-ins/Function/prototype/restricted-property-arguments.js +PASS e:/dd/test262/test262/test/built-ins/Function/prototype/restricted-property-arguments.js +PASS e:/dd/test262/test262/test/built-ins/Function/prototype/restricted-property-caller.js +PASS e:/dd/test262/test262/test/built-ins/Function/prototype/restricted-property-caller.js +PASS e:/dd/test262/test262/test/built-ins/ThrowTypeError/forbidden-arguments.js +PASS e:/dd/test262/test262/test/built-ins/ThrowTypeError/forbidden-arguments.js +PASS e:/dd/test262/test262/test/built-ins/ThrowTypeError/forbidden-caller.js +PASS e:/dd/test262/test262/test/built-ins/ThrowTypeError/forbidden-caller.js ``` Reviewed-By: chakrabot --- .../Runtime/Library/JavascriptFunction.cpp | 6 +- .../lib/Runtime/Library/JavascriptLibrary.cpp | 5 + ...sBuiltInEngineInterfaceExtensionObject.cpp | 2 - .../ES6_intl_simple_attach.js.dbg.baseline | 140 ++--- .../ES6_proto_invalidation.js.dbg.baseline | 492 +++++------------- ...S6_proto_userDefinedObject.js.dbg.baseline | 58 +-- .../TempStrExpr.js.dbg.baseline | 16 +- .../DebuggerCommon/TypedArray.js.dbg.baseline | 30 +- .../array_protoTest.js.dbg.baseline | 20 +- ...lockScopeBasicLetConstTest.js.dbg.baseline | 4 +- .../DebuggerCommon/bug_543550.js.dbg.baseline | 44 +- .../bug_os_2946365.js.dbg.baseline | 36 +- .../frames_values_mapES6.js.dbg.baseline | 178 ++----- .../DebuggerCommon/indexprop.js.dbg.baseline | 12 +- ...nterpreted_function_attach.js.dbg.baseline | 12 +- .../stringkeyedtypehandler.js.dbg.baseline | 10 +- .../DebuggerCommon/symbols.js.dbg.baseline | 68 +-- .../DebuggerCommon/targeted.js.dbg.baseline | 48 +- .../builtinFuncHasOwnPropCallerArguments.js | 96 ++++ deps/chakrashim/core/test/Function/rlexe.xml | 6 + .../test/Function/typeErrorAccessor.baseline | 26 +- .../core/test/Function/typeErrorAccessor.js | 8 +- .../core/test/es6/ES6RestrictedProperties.js | 73 ++- .../chakrashim/core/test/es6/function.name.js | 2 +- 24 files changed, 521 insertions(+), 871 deletions(-) create mode 100644 deps/chakrashim/core/test/Function/builtinFuncHasOwnPropCallerArguments.js diff --git a/deps/chakrashim/core/lib/Runtime/Library/JavascriptFunction.cpp b/deps/chakrashim/core/lib/Runtime/Library/JavascriptFunction.cpp index 73c06452b2f..32492e6e4be 100644 --- a/deps/chakrashim/core/lib/Runtime/Library/JavascriptFunction.cpp +++ b/deps/chakrashim/core/lib/Runtime/Library/JavascriptFunction.cpp @@ -2467,8 +2467,10 @@ void __cdecl _alloca_probe_16() this->functionInfo->IsLambda() || this->functionInfo->IsAsync() || this->IsGeneratorFunction() || - this->IsBoundFunction() || - this->IsStrictMode() + this->IsStrictMode() || + !this->IsScriptFunction() || // -> (BoundFunction || RuntimeFunction) // (RuntimeFunction = Native-defined built-in library functions) + this->IsLibraryCode() || // JS-defined built-in library functions + this == this->GetLibrary()->GetFunctionPrototype() // the intrinsic %FunctionPrototype% (original value of Function.prototype) ); } diff --git a/deps/chakrashim/core/lib/Runtime/Library/JavascriptLibrary.cpp b/deps/chakrashim/core/lib/Runtime/Library/JavascriptLibrary.cpp index f3fc1fb8e6c..20aab8c9d0a 100644 --- a/deps/chakrashim/core/lib/Runtime/Library/JavascriptLibrary.cpp +++ b/deps/chakrashim/core/lib/Runtime/Library/JavascriptLibrary.cpp @@ -2811,6 +2811,11 @@ namespace Js functionPrototype->SetConfigurable(PropertyIds::_symbolHasInstance, false); } + functionPrototype->DynamicObject::SetAccessors(PropertyIds::caller, library->throwTypeErrorRestrictedPropertyAccessorFunction, library->throwTypeErrorRestrictedPropertyAccessorFunction); + functionPrototype->SetEnumerable(PropertyIds::caller, false); + functionPrototype->DynamicObject::SetAccessors(PropertyIds::arguments, library->throwTypeErrorRestrictedPropertyAccessorFunction, library->throwTypeErrorRestrictedPropertyAccessorFunction); + functionPrototype->SetEnumerable(PropertyIds::arguments, false); + DebugOnly(CheckRegisteredBuiltIns(builtinFuncs, scriptContext)); functionPrototype->SetHasNoEnumerableProperties(true); diff --git a/deps/chakrashim/core/lib/Runtime/Library/JsBuiltInEngineInterfaceExtensionObject.cpp b/deps/chakrashim/core/lib/Runtime/Library/JsBuiltInEngineInterfaceExtensionObject.cpp index c8d845f536e..63e4c2f1bc7 100644 --- a/deps/chakrashim/core/lib/Runtime/Library/JsBuiltInEngineInterfaceExtensionObject.cpp +++ b/deps/chakrashim/core/lib/Runtime/Library/JsBuiltInEngineInterfaceExtensionObject.cpp @@ -349,8 +349,6 @@ namespace Js scriptFunction->GetFunctionBody()->SetJsBuiltInForceInline(); } scriptFunction->SetPropertyWithAttributes(PropertyIds::length, TaggedInt::ToVarUnchecked(argumentsCount), PropertyConfigurable, nullptr); - scriptFunction->SetPropertyWithAttributes(PropertyIds::caller, library->nullValue, PropertyNone, nullptr); - scriptFunction->SetPropertyWithAttributes(PropertyIds::arguments, library->nullValue, PropertyNone, nullptr); scriptFunction->SetConfigurable(PropertyIds::prototype, true); scriptFunction->DeleteProperty(PropertyIds::prototype, Js::PropertyOperationFlags::PropertyOperation_None); diff --git a/deps/chakrashim/core/test/DebuggerCommon/ES6_intl_simple_attach.js.dbg.baseline b/deps/chakrashim/core/test/DebuggerCommon/ES6_intl_simple_attach.js.dbg.baseline index e083b238844..fc472b23a7a 100644 --- a/deps/chakrashim/core/test/DebuggerCommon/ES6_intl_simple_attach.js.dbg.baseline +++ b/deps/chakrashim/core/test/DebuggerCommon/ES6_intl_simple_attach.js.dbg.baseline @@ -1,8 +1,8 @@ [ { "this": { - "Run": "function ", - "x": "undefined undefined" + "x": "undefined undefined", + "Run": "function " }, "arguments": { "#__proto__": "Object {...}", @@ -22,8 +22,8 @@ } }, "globals": { - "Run": "function ", - "x": "undefined undefined" + "x": "undefined undefined", + "Run": "function " } }, { @@ -55,80 +55,58 @@ "is": "function ", "assign": "function ", "values": "function ", - "entries": "function ", - "caller": "object null", - "arguments": "object null" + "entries": "function " }, "hasOwnProperty": { "#__proto__": "function ", "length": "number 1", - "name": "string hasOwnProperty", - "caller": "object null", - "arguments": "object null" + "name": "string hasOwnProperty" }, "propertyIsEnumerable": { "#__proto__": "function ", "length": "number 1", - "name": "string ", - "caller": "object null", - "arguments": "object null" + "name": "string " }, "isPrototypeOf": { "#__proto__": "function ", "length": "number 1", - "name": "string isPrototypeOf", - "caller": "object null", - "arguments": "object null" + "name": "string isPrototypeOf" }, "toLocaleString": { "#__proto__": "function ", "length": "number 0", - "name": "string toLocaleString", - "caller": "object null", - "arguments": "object null" + "name": "string toLocaleString" }, "toString": { "#__proto__": "function ", "length": "number 0", - "name": "string toString", - "caller": "object null", - "arguments": "object null" + "name": "string toString" }, "valueOf": { "#__proto__": "function ", "length": "number 0", - "name": "string valueOf", - "caller": "object null", - "arguments": "object null" + "name": "string valueOf" }, "#__proto__": "object null", "__defineGetter__": { "#__proto__": "function ", "length": "number 2", - "name": "string __defineGetter__", - "caller": "object null", - "arguments": "object null" + "name": "string __defineGetter__" }, "__defineSetter__": { "#__proto__": "function ", "length": "number 2", - "name": "string __defineSetter__", - "caller": "object null", - "arguments": "object null" + "name": "string __defineSetter__" }, "__lookupGetter__": { "#__proto__": "function ", "length": "number 1", - "name": "string __lookupGetter__", - "caller": "object null", - "arguments": "object null" + "name": "string __lookupGetter__" }, "__lookupSetter__": { "#__proto__": "function ", "length": "number 1", - "name": "string __lookupSetter__", - "caller": "object null", - "arguments": "object null" + "name": "string __lookupSetter__" } }, "constructor": { @@ -225,80 +203,58 @@ "is": "function ", "assign": "function ", "values": "function ", - "entries": "function ", - "caller": "object null", - "arguments": "object null" + "entries": "function " }, "hasOwnProperty": { "#__proto__": "function ", "length": "number 1", - "name": "string hasOwnProperty", - "caller": "object null", - "arguments": "object null" + "name": "string hasOwnProperty" }, "propertyIsEnumerable": { "#__proto__": "function ", "length": "number 1", - "name": "string ", - "caller": "object null", - "arguments": "object null" + "name": "string " }, "isPrototypeOf": { "#__proto__": "function ", "length": "number 1", - "name": "string isPrototypeOf", - "caller": "object null", - "arguments": "object null" + "name": "string isPrototypeOf" }, "toLocaleString": { "#__proto__": "function ", "length": "number 0", - "name": "string toLocaleString", - "caller": "object null", - "arguments": "object null" + "name": "string toLocaleString" }, "toString": { "#__proto__": "function ", "length": "number 0", - "name": "string toString", - "caller": "object null", - "arguments": "object null" + "name": "string toString" }, "valueOf": { "#__proto__": "function ", "length": "number 0", - "name": "string valueOf", - "caller": "object null", - "arguments": "object null" + "name": "string valueOf" }, "#__proto__": "object null", "__defineGetter__": { "#__proto__": "function ", "length": "number 2", - "name": "string __defineGetter__", - "caller": "object null", - "arguments": "object null" + "name": "string __defineGetter__" }, "__defineSetter__": { "#__proto__": "function ", "length": "number 2", - "name": "string __defineSetter__", - "caller": "object null", - "arguments": "object null" + "name": "string __defineSetter__" }, "__lookupGetter__": { "#__proto__": "function ", "length": "number 1", - "name": "string __lookupGetter__", - "caller": "object null", - "arguments": "object null" + "name": "string __lookupGetter__" }, "__lookupSetter__": { "#__proto__": "function ", "length": "number 1", - "name": "string __lookupSetter__", - "caller": "object null", - "arguments": "object null" + "name": "string __lookupSetter__" } }, "constructor": { @@ -395,80 +351,58 @@ "is": "function ", "assign": "function ", "values": "function ", - "entries": "function ", - "caller": "object null", - "arguments": "object null" + "entries": "function " }, "hasOwnProperty": { "#__proto__": "function ", "length": "number 1", - "name": "string hasOwnProperty", - "caller": "object null", - "arguments": "object null" + "name": "string hasOwnProperty" }, "propertyIsEnumerable": { "#__proto__": "function ", "length": "number 1", - "name": "string ", - "caller": "object null", - "arguments": "object null" + "name": "string " }, "isPrototypeOf": { "#__proto__": "function ", "length": "number 1", - "name": "string isPrototypeOf", - "caller": "object null", - "arguments": "object null" + "name": "string isPrototypeOf" }, "toLocaleString": { "#__proto__": "function ", "length": "number 0", - "name": "string toLocaleString", - "caller": "object null", - "arguments": "object null" + "name": "string toLocaleString" }, "toString": { "#__proto__": "function ", "length": "number 0", - "name": "string toString", - "caller": "object null", - "arguments": "object null" + "name": "string toString" }, "valueOf": { "#__proto__": "function ", "length": "number 0", - "name": "string valueOf", - "caller": "object null", - "arguments": "object null" + "name": "string valueOf" }, "#__proto__": "object null", "__defineGetter__": { "#__proto__": "function ", "length": "number 2", - "name": "string __defineGetter__", - "caller": "object null", - "arguments": "object null" + "name": "string __defineGetter__" }, "__defineSetter__": { "#__proto__": "function ", "length": "number 2", - "name": "string __defineSetter__", - "caller": "object null", - "arguments": "object null" + "name": "string __defineSetter__" }, "__lookupGetter__": { "#__proto__": "function ", "length": "number 1", - "name": "string __lookupGetter__", - "caller": "object null", - "arguments": "object null" + "name": "string __lookupGetter__" }, "__lookupSetter__": { "#__proto__": "function ", "length": "number 1", - "name": "string __lookupSetter__", - "caller": "object null", - "arguments": "object null" + "name": "string __lookupSetter__" } }, "constructor": { diff --git a/deps/chakrashim/core/test/DebuggerCommon/ES6_proto_invalidation.js.dbg.baseline b/deps/chakrashim/core/test/DebuggerCommon/ES6_proto_invalidation.js.dbg.baseline index de3bebd05a1..1ccb28ad3ab 100644 --- a/deps/chakrashim/core/test/DebuggerCommon/ES6_proto_invalidation.js.dbg.baseline +++ b/deps/chakrashim/core/test/DebuggerCommon/ES6_proto_invalidation.js.dbg.baseline @@ -24,317 +24,227 @@ "name": "string String", "fromCharCode": "function ", "fromCodePoint": "function ", - "raw": "function ", - "caller": "object null", - "arguments": "object null" + "raw": "function " }, "indexOf": { "#__proto__": "function ", "length": "number 1", - "name": "string indexOf", - "caller": "object null", - "arguments": "object null" + "name": "string indexOf" }, "lastIndexOf": { "#__proto__": "function ", "length": "number 1", - "name": "string lastIndexOf", - "caller": "object null", - "arguments": "object null" + "name": "string lastIndexOf" }, "replace": { "#__proto__": "function ", "length": "number 2", - "name": "string replace", - "caller": "object null", - "arguments": "object null" + "name": "string replace" }, "search": { "#__proto__": "function ", "length": "number 1", - "name": "string search", - "caller": "object null", - "arguments": "object null" + "name": "string search" }, "slice": { "#__proto__": "function ", "length": "number 2", - "name": "string slice", - "caller": "object null", - "arguments": "object null" + "name": "string slice" }, "codePointAt": { "#__proto__": "function ", "length": "number 1", - "name": "string codePointAt", - "caller": "object null", - "arguments": "object null" + "name": "string codePointAt" }, "normalize": { "#__proto__": "function ", "length": "number 0", - "name": "string normalize", - "caller": "object null", - "arguments": "object null" + "name": "string normalize" }, "charAt": { "#__proto__": "function ", "length": "number 1", - "name": "string charAt", - "caller": "object null", - "arguments": "object null" + "name": "string charAt" }, "charCodeAt": { "#__proto__": "function ", "length": "number 1", - "name": "string charCodeAt", - "caller": "object null", - "arguments": "object null" + "name": "string charCodeAt" }, "concat": { "#__proto__": "function ", "length": "number 1", - "name": "string concat", - "caller": "object null", - "arguments": "object null" + "name": "string concat" }, "localeCompare": { "#__proto__": "function ", "length": "number 1", - "name": "string localeCompare", - "caller": "object null", - "arguments": "object null" + "name": "string localeCompare" }, "match": { "#__proto__": "function ", "length": "number 1", - "name": "string match", - "caller": "object null", - "arguments": "object null" + "name": "string match" }, "split": { "#__proto__": "function ", "length": "number 2", - "name": "string split", - "caller": "object null", - "arguments": "object null" + "name": "string split" }, "substring": { "#__proto__": "function ", "length": "number 2", - "name": "string substring", - "caller": "object null", - "arguments": "object null" + "name": "string substring" }, "substr": { "#__proto__": "function ", "length": "number 2", - "name": "string substr", - "caller": "object null", - "arguments": "object null" + "name": "string substr" }, "toLocaleLowerCase": { "#__proto__": "function ", "length": "number 0", - "name": "string ", - "caller": "object null", - "arguments": "object null" + "name": "string " }, "toLocaleUpperCase": { "#__proto__": "function ", "length": "number 0", - "name": "string ", - "caller": "object null", - "arguments": "object null" + "name": "string " }, "toLowerCase": { "#__proto__": "function ", "length": "number 0", - "name": "string toLowerCase", - "caller": "object null", - "arguments": "object null" + "name": "string toLowerCase" }, "toString": { "#__proto__": "function ", "length": "number 0", - "name": "string toString", - "caller": "object null", - "arguments": "object null" + "name": "string toString" }, "toUpperCase": { "#__proto__": "function ", "length": "number 0", - "name": "string toUpperCase", - "caller": "object null", - "arguments": "object null" + "name": "string toUpperCase" }, "trim": { "#__proto__": "function ", "length": "number 0", - "name": "string trim", - "caller": "object null", - "arguments": "object null" + "name": "string trim" }, "valueOf": { "#__proto__": "function ", "length": "number 0", - "name": "string valueOf", - "caller": "object null", - "arguments": "object null" + "name": "string valueOf" }, "anchor": { "#__proto__": "function ", "length": "number 1", - "name": "string anchor", - "caller": "object null", - "arguments": "object null" + "name": "string anchor" }, "big": { "#__proto__": "function ", "length": "number 0", - "name": "string big", - "caller": "object null", - "arguments": "object null" + "name": "string big" }, "blink": { "#__proto__": "function ", "length": "number 0", - "name": "string blink", - "caller": "object null", - "arguments": "object null" + "name": "string blink" }, "bold": { "#__proto__": "function ", "length": "number 0", - "name": "string bold", - "caller": "object null", - "arguments": "object null" + "name": "string bold" }, "fixed": { "#__proto__": "function ", "length": "number 0", - "name": "string fixed", - "caller": "object null", - "arguments": "object null" + "name": "string fixed" }, "fontcolor": { "#__proto__": "function ", "length": "number 1", - "name": "string fontcolor", - "caller": "object null", - "arguments": "object null" + "name": "string fontcolor" }, "fontsize": { "#__proto__": "function ", "length": "number 1", - "name": "string fontsize", - "caller": "object null", - "arguments": "object null" + "name": "string fontsize" }, "italics": { "#__proto__": "function ", "length": "number 0", - "name": "string italics", - "caller": "object null", - "arguments": "object null" + "name": "string italics" }, "link": { "#__proto__": "function ", "length": "number 1", - "name": "string link", - "caller": "object null", - "arguments": "object null" + "name": "string link" }, "small": { "#__proto__": "function ", "length": "number 0", - "name": "string small", - "caller": "object null", - "arguments": "object null" + "name": "string small" }, "strike": { "#__proto__": "function ", "length": "number 0", - "name": "string strike", - "caller": "object null", - "arguments": "object null" + "name": "string strike" }, "sub": { "#__proto__": "function ", "length": "number 0", - "name": "string sub", - "caller": "object null", - "arguments": "object null" + "name": "string sub" }, "sup": { "#__proto__": "function ", "length": "number 0", - "name": "string sup", - "caller": "object null", - "arguments": "object null" + "name": "string sup" }, "repeat": { "#__proto__": "function ", "length": "number 1", - "name": "string repeat", - "caller": "object null", - "arguments": "object null" + "name": "string repeat" }, "startsWith": { "#__proto__": "function ", "length": "number 1", - "name": "string startsWith", - "caller": "object null", - "arguments": "object null" + "name": "string startsWith" }, "endsWith": { "#__proto__": "function ", "length": "number 1", - "name": "string endsWith", - "caller": "object null", - "arguments": "object null" + "name": "string endsWith" }, "includes": { "#__proto__": "function ", "length": "number 1", - "name": "string includes", - "caller": "object null", - "arguments": "object null" + "name": "string includes" }, "trimLeft": { "#__proto__": "function ", "length": "number 0", - "name": "string trimLeft", - "caller": "object null", - "arguments": "object null" + "name": "string trimLeft" }, "trimRight": { "#__proto__": "function ", "length": "number 0", - "name": "string trimRight", - "caller": "object null", - "arguments": "object null" + "name": "string trimRight" }, "Symbol.iterator": { "#__proto__": "function ", "length": "number 0", - "name": "string ", - "caller": "object null", - "arguments": "object null" + "name": "string " }, "padStart": { "#__proto__": "function ", "length": "number 1", - "name": "string padStart", - "caller": "object null", - "arguments": "object null" + "name": "string padStart" }, "padEnd": { "#__proto__": "function ", "length": "number 1", - "name": "string padEnd", - "caller": "object null", - "arguments": "object null" + "name": "string padEnd" }, "length": "number 0" }, @@ -363,34 +273,6 @@ "__lookupGetter__": "function ", "__lookupSetter__": "function " }, - "values": { - "#__proto__": "function ", - "name": "string values", - "length": "number 0", - "caller": "object null", - "arguments": "object null" - }, - "Symbol.iterator": { - "#__proto__": "function ", - "name": "string values", - "length": "number 0", - "caller": "object null", - "arguments": "object null" - }, - "entries": { - "#__proto__": "function ", - "name": "string entries", - "length": "number 0", - "caller": "object null", - "arguments": "object null" - }, - "keys": { - "#__proto__": "function ", - "name": "string keys", - "length": "number 0", - "caller": "object null", - "arguments": "object null" - }, "constructor": { "#__proto__": "function ", "length": "number 1", @@ -399,170 +281,142 @@ "name": "string Array", "isArray": "function ", "from": "function ", - "of": "function ", - "caller": "object null", - "arguments": "object null" + "of": "function " }, "push": { "#__proto__": "function ", "length": "number 1", - "name": "string push", - "caller": "object null", - "arguments": "object null" + "name": "string push" }, "concat": { "#__proto__": "function ", "length": "number 1", - "name": "string concat", - "caller": "object null", - "arguments": "object null" + "name": "string concat" }, "join": { "#__proto__": "function ", "length": "number 1", - "name": "string join", - "caller": "object null", - "arguments": "object null" + "name": "string join" }, "pop": { "#__proto__": "function ", "length": "number 0", - "name": "string pop", - "caller": "object null", - "arguments": "object null" + "name": "string pop" }, "reverse": { "#__proto__": "function ", "length": "number 0", - "name": "string reverse", - "caller": "object null", - "arguments": "object null" + "name": "string reverse" }, "shift": { "#__proto__": "function ", "length": "number 0", - "name": "string shift", - "caller": "object null", - "arguments": "object null" + "name": "string shift" }, "slice": { "#__proto__": "function ", "length": "number 2", - "name": "string slice", - "caller": "object null", - "arguments": "object null" + "name": "string slice" }, "sort": { "#__proto__": "function ", "length": "number 1", - "name": "string sort", - "caller": "object null", - "arguments": "object null" + "name": "string sort" }, "splice": { "#__proto__": "function ", "length": "number 2", - "name": "string splice", - "caller": "object null", - "arguments": "object null" + "name": "string splice" }, "toLocaleString": { "#__proto__": "function ", "length": "number 0", - "name": "string toLocaleString", - "caller": "object null", - "arguments": "object null" + "name": "string toLocaleString" }, "toString": { "#__proto__": "function ", "length": "number 0", - "name": "string toString", - "caller": "object null", - "arguments": "object null" + "name": "string toString" }, "unshift": { "#__proto__": "function ", "length": "number 1", - "name": "string unshift", - "caller": "object null", - "arguments": "object null" + "name": "string unshift" }, "indexOf": { "#__proto__": "function ", "length": "number 1", - "name": "string indexOf", - "caller": "object null", - "arguments": "object null" + "name": "string indexOf" }, "every": { "#__proto__": "function ", "length": "number 1", - "name": "string every", - "caller": "object null", - "arguments": "object null" + "name": "string every" }, "filter": { "#__proto__": "function ", "length": "number 1", - "name": "string filter", - "caller": "object null", - "arguments": "object null" + "name": "string filter" }, "forEach": { "#__proto__": "function ", "length": "number 1", - "name": "string forEach", - "caller": "object null", - "arguments": "object null" + "name": "string forEach" }, "lastIndexOf": { "#__proto__": "function ", "length": "number 1", - "name": "string lastIndexOf", - "caller": "object null", - "arguments": "object null" + "name": "string lastIndexOf" }, "map": { "#__proto__": "function ", "length": "number 1", - "name": "string map", - "caller": "object null", - "arguments": "object null" + "name": "string map" }, "reduce": { "#__proto__": "function ", "length": "number 1", - "name": "string reduce", - "caller": "object null", - "arguments": "object null" + "name": "string reduce" }, "reduceRight": { "#__proto__": "function ", "length": "number 1", - "name": "string reduceRight", - "caller": "object null", - "arguments": "object null" + "name": "string reduceRight" }, "some": { "#__proto__": "function ", "length": "number 1", - "name": "string some", - "caller": "object null", - "arguments": "object null" + "name": "string some" }, "find": { "#__proto__": "function ", "length": "number 1", - "name": "string find", - "caller": "object null", - "arguments": "object null" + "name": "string find" }, "findIndex": { "#__proto__": "function ", "length": "number 1", - "name": "string findIndex", - "caller": "object null", - "arguments": "object null" + "name": "string findIndex" + }, + "keys": { + "#__proto__": "function ", + "name": "string keys", + "length": "number 0" + }, + "values": { + "#__proto__": "function ", + "name": "string values", + "length": "number 0" + }, + "Symbol.iterator": { + "#__proto__": "function ", + "name": "string values", + "length": "number 0" + }, + "entries": { + "#__proto__": "function ", + "name": "string entries", + "length": "number 0" }, "Symbol.unscopables": { "find": "boolean true", @@ -577,23 +431,17 @@ "fill": { "#__proto__": "function ", "length": "number 1", - "name": "string fill", - "caller": "object null", - "arguments": "object null" + "name": "string fill" }, "copyWithin": { "#__proto__": "function ", "length": "number 2", - "name": "string copyWithin", - "caller": "object null", - "arguments": "object null" + "name": "string copyWithin" }, "includes": { "#__proto__": "function ", "length": "number 1", - "name": "string includes", - "caller": "object null", - "arguments": "object null" + "name": "string includes" }, "length": "number 0" }, @@ -642,34 +490,6 @@ "__lookupGetter__": "function ", "__lookupSetter__": "function " }, - "values": { - "#__proto__": "function ", - "name": "string values", - "length": "number 0", - "caller": "object null", - "arguments": "object null" - }, - "Symbol.iterator": { - "#__proto__": "function ", - "name": "string values", - "length": "number 0", - "caller": "object null", - "arguments": "object null" - }, - "entries": { - "#__proto__": "function ", - "name": "string entries", - "length": "number 0", - "caller": "object null", - "arguments": "object null" - }, - "keys": { - "#__proto__": "function ", - "name": "string keys", - "length": "number 0", - "caller": "object null", - "arguments": "object null" - }, "constructor": { "#__proto__": "function ", "length": "number 1", @@ -678,170 +498,142 @@ "name": "string Array", "isArray": "function ", "from": "function ", - "of": "function ", - "caller": "object null", - "arguments": "object null" + "of": "function " }, "push": { "#__proto__": "function ", "length": "number 1", - "name": "string push", - "caller": "object null", - "arguments": "object null" + "name": "string push" }, "concat": { "#__proto__": "function ", "length": "number 1", - "name": "string concat", - "caller": "object null", - "arguments": "object null" + "name": "string concat" }, "join": { "#__proto__": "function ", "length": "number 1", - "name": "string join", - "caller": "object null", - "arguments": "object null" + "name": "string join" }, "pop": { "#__proto__": "function ", "length": "number 0", - "name": "string pop", - "caller": "object null", - "arguments": "object null" + "name": "string pop" }, "reverse": { "#__proto__": "function ", "length": "number 0", - "name": "string reverse", - "caller": "object null", - "arguments": "object null" + "name": "string reverse" }, "shift": { "#__proto__": "function ", "length": "number 0", - "name": "string shift", - "caller": "object null", - "arguments": "object null" + "name": "string shift" }, "slice": { "#__proto__": "function ", "length": "number 2", - "name": "string slice", - "caller": "object null", - "arguments": "object null" + "name": "string slice" }, "sort": { "#__proto__": "function ", "length": "number 1", - "name": "string sort", - "caller": "object null", - "arguments": "object null" + "name": "string sort" }, "splice": { "#__proto__": "function ", "length": "number 2", - "name": "string splice", - "caller": "object null", - "arguments": "object null" + "name": "string splice" }, "toLocaleString": { "#__proto__": "function ", "length": "number 0", - "name": "string toLocaleString", - "caller": "object null", - "arguments": "object null" + "name": "string toLocaleString" }, "toString": { "#__proto__": "function ", "length": "number 0", - "name": "string toString", - "caller": "object null", - "arguments": "object null" + "name": "string toString" }, "unshift": { "#__proto__": "function ", "length": "number 1", - "name": "string unshift", - "caller": "object null", - "arguments": "object null" + "name": "string unshift" }, "indexOf": { "#__proto__": "function ", "length": "number 1", - "name": "string indexOf", - "caller": "object null", - "arguments": "object null" + "name": "string indexOf" }, "every": { "#__proto__": "function ", "length": "number 1", - "name": "string every", - "caller": "object null", - "arguments": "object null" + "name": "string every" }, "filter": { "#__proto__": "function ", "length": "number 1", - "name": "string filter", - "caller": "object null", - "arguments": "object null" + "name": "string filter" }, "forEach": { "#__proto__": "function ", "length": "number 1", - "name": "string forEach", - "caller": "object null", - "arguments": "object null" + "name": "string forEach" }, "lastIndexOf": { "#__proto__": "function ", "length": "number 1", - "name": "string lastIndexOf", - "caller": "object null", - "arguments": "object null" + "name": "string lastIndexOf" }, "map": { "#__proto__": "function ", "length": "number 1", - "name": "string map", - "caller": "object null", - "arguments": "object null" + "name": "string map" }, "reduce": { "#__proto__": "function ", "length": "number 1", - "name": "string reduce", - "caller": "object null", - "arguments": "object null" + "name": "string reduce" }, "reduceRight": { "#__proto__": "function ", "length": "number 1", - "name": "string reduceRight", - "caller": "object null", - "arguments": "object null" + "name": "string reduceRight" }, "some": { "#__proto__": "function ", "length": "number 1", - "name": "string some", - "caller": "object null", - "arguments": "object null" + "name": "string some" }, "find": { "#__proto__": "function ", "length": "number 1", - "name": "string find", - "caller": "object null", - "arguments": "object null" + "name": "string find" }, "findIndex": { "#__proto__": "function ", "length": "number 1", - "name": "string findIndex", - "caller": "object null", - "arguments": "object null" + "name": "string findIndex" + }, + "keys": { + "#__proto__": "function ", + "name": "string keys", + "length": "number 0" + }, + "values": { + "#__proto__": "function ", + "name": "string values", + "length": "number 0" + }, + "Symbol.iterator": { + "#__proto__": "function ", + "name": "string values", + "length": "number 0" + }, + "entries": { + "#__proto__": "function ", + "name": "string entries", + "length": "number 0" }, "Symbol.unscopables": { "find": "boolean true", @@ -856,23 +648,17 @@ "fill": { "#__proto__": "function ", "length": "number 1", - "name": "string fill", - "caller": "object null", - "arguments": "object null" + "name": "string fill" }, "copyWithin": { "#__proto__": "function ", "length": "number 2", - "name": "string copyWithin", - "caller": "object null", - "arguments": "object null" + "name": "string copyWithin" }, "includes": { "#__proto__": "function ", "length": "number 1", - "name": "string includes", - "caller": "object null", - "arguments": "object null" + "name": "string includes" }, "length": "number 0" }, diff --git a/deps/chakrashim/core/test/DebuggerCommon/ES6_proto_userDefinedObject.js.dbg.baseline b/deps/chakrashim/core/test/DebuggerCommon/ES6_proto_userDefinedObject.js.dbg.baseline index 3339da3cbbe..6ba7d2ca063 100644 --- a/deps/chakrashim/core/test/DebuggerCommon/ES6_proto_userDefinedObject.js.dbg.baseline +++ b/deps/chakrashim/core/test/DebuggerCommon/ES6_proto_userDefinedObject.js.dbg.baseline @@ -1,14 +1,6 @@ [ { "this": { - "MyObj": { - "#__proto__": "function ", - "prototype": "Object {...}", - "name": "string MyObj", - "caller": "object null", - "arguments": "object null", - "length": "number 0" - }, "a": { "#__proto__": "Object {...}", "x": "number 2" @@ -21,32 +13,17 @@ "#__proto__": "Object {...}", "z": "number 1", "[1]": "string \"MyObjIndex\"" - } - }, - "locals": { + }, "MyObj": { - "#__proto__": { - "#__proto__": "Object {...}", - "constructor": "function ", - "length": "number 0", - "name": "string ", - "apply": "function ", - "bind": "function ", - "call": "function ", - "toString": "function ", - "Symbol.hasInstance": "function ", - "caller": "object null", - "arguments": "object null" - }, - "prototype": { - "#__proto__": "Object {...}", - "constructor": "function " - }, + "#__proto__": "function ", + "prototype": "Object {...}", "name": "string MyObj", "caller": "object null", "arguments": "object null", "length": "number 0" - }, + } + }, + "locals": { "a": { "#__proto__": { "constructor": "function ", @@ -78,6 +55,29 @@ }, "z": "number 1", "[1]": "string \"MyObjIndex\"" + }, + "MyObj": { + "#__proto__": { + "#__proto__": "Object {...}", + "constructor": "function ", + "length": "number 0", + "name": "string ", + "apply": "function ", + "bind": "function ", + "call": "function ", + "toString": "function ", + "Symbol.hasInstance": "function ", + "caller": "Error ", + "arguments": "Error " + }, + "prototype": { + "#__proto__": "Object {...}", + "constructor": "function " + }, + "name": "string MyObj", + "caller": "object null", + "arguments": "object null", + "length": "number 0" } }, "globals": {} diff --git a/deps/chakrashim/core/test/DebuggerCommon/TempStrExpr.js.dbg.baseline b/deps/chakrashim/core/test/DebuggerCommon/TempStrExpr.js.dbg.baseline index 8d78bb9569e..30e8cba4a8e 100644 --- a/deps/chakrashim/core/test/DebuggerCommon/TempStrExpr.js.dbg.baseline +++ b/deps/chakrashim/core/test/DebuggerCommon/TempStrExpr.js.dbg.baseline @@ -180,26 +180,18 @@ "fromCharCode": { "#__proto__": "function ", "length": "number 1", - "name": "string fromCharCode", - "caller": "object null", - "arguments": "object null" + "name": "string fromCharCode" }, "fromCodePoint": { "#__proto__": "function ", "length": "number 1", - "name": "string fromCodePoint", - "caller": "object null", - "arguments": "object null" + "name": "string fromCodePoint" }, "raw": { "#__proto__": "function ", "length": "number 1", - "name": "string raw", - "caller": "object null", - "arguments": "object null" - }, - "caller": "object null", - "arguments": "object null" + "name": "string raw" + } } } }, diff --git a/deps/chakrashim/core/test/DebuggerCommon/TypedArray.js.dbg.baseline b/deps/chakrashim/core/test/DebuggerCommon/TypedArray.js.dbg.baseline index 540d39970cf..b7c2396547a 100644 --- a/deps/chakrashim/core/test/DebuggerCommon/TypedArray.js.dbg.baseline +++ b/deps/chakrashim/core/test/DebuggerCommon/TypedArray.js.dbg.baseline @@ -56,28 +56,20 @@ "from": { "#__proto__": "function function() {\n [native code]\n}", "length": "number 1", - "name": "string from", - "caller": "object null", - "arguments": "object null" + "name": "string from" }, "of": { "#__proto__": "function function() {\n [native code]\n}", "length": "number 0", - "name": "string of", - "caller": "object null", - "arguments": "object null" + "name": "string of" }, "Symbol.species": { "#__proto__": "function function() {\n [native code]\n}", "length": "number 3", "name": "string Int8Array", "BYTES_PER_ELEMENT": "number 1", - "prototype": "Object {...}", - "caller": "object null", - "arguments": "object null" - }, - "caller": "object null", - "arguments": "object null" + "prototype": "Object {...}" + } }, "length": "number 3", "name": "string Int8Array", @@ -123,14 +115,10 @@ "length": "number 3", "name": "string Int8Array", "BYTES_PER_ELEMENT": "number 1", - "prototype": "Object {...}", - "caller": "object null", - "arguments": "object null" + "prototype": "Object {...}" }, "BYTES_PER_ELEMENT": "number 1" - }, - "caller": "object null", - "arguments": "object null" + } } } }, @@ -178,9 +166,7 @@ "length": "number 3", "name": "string Int8Array", "BYTES_PER_ELEMENT": "number 1", - "prototype": "Object {...}", - "caller": "object null", - "arguments": "object null" + "prototype": "Object {...}" }, "BYTES_PER_ELEMENT": "number 1" }, @@ -348,4 +334,4 @@ } ] } -] +] \ No newline at end of file diff --git a/deps/chakrashim/core/test/DebuggerCommon/array_protoTest.js.dbg.baseline b/deps/chakrashim/core/test/DebuggerCommon/array_protoTest.js.dbg.baseline index 1ebde7c48df..873987bb552 100644 --- a/deps/chakrashim/core/test/DebuggerCommon/array_protoTest.js.dbg.baseline +++ b/deps/chakrashim/core/test/DebuggerCommon/array_protoTest.js.dbg.baseline @@ -52,10 +52,8 @@ }, "Symbol.iterator": { "#__proto__": "function ", - "length": "number 0", "name": "string values", - "caller": "object null", - "arguments": "object null" + "length": "number 0" } }, "locals": { @@ -86,10 +84,10 @@ "some": "function ", "find": "function ", "findIndex": "function ", - "entries": "function ", "keys": "function ", "values": "function ", "Symbol.iterator": "function ", + "entries": "function ", "Symbol.unscopables": "Object {...}", "fill": "function ", "copyWithin": "function ", @@ -127,10 +125,10 @@ "some": "function ", "find": "function ", "findIndex": "function ", - "entries": "function ", "keys": "function ", "values": "function ", "Symbol.iterator": "function ", + "entries": "function ", "Symbol.unscopables": "Object {...}", "fill": "function ", "copyWithin": "function ", @@ -169,10 +167,10 @@ "some": "function ", "find": "function ", "findIndex": "function ", - "entries": "function ", "keys": "function ", "values": "function ", "Symbol.iterator": "function ", + "entries": "function ", "Symbol.unscopables": "Object {...}", "fill": "function ", "copyWithin": "function ", @@ -274,10 +272,8 @@ }, "Symbol.iterator": { "#__proto__": "function ", - "length": "number 0", "name": "string values", - "caller": "object null", - "arguments": "object null" + "length": "number 0" } }, "locals": { @@ -308,10 +304,10 @@ "some": "function ", "find": "function ", "findIndex": "function ", - "entries": "function ", "keys": "function ", "values": "function ", "Symbol.iterator": "function ", + "entries": "function ", "Symbol.unscopables": "Object {...}", "fill": "function ", "copyWithin": "function ", @@ -349,10 +345,10 @@ "some": "function ", "find": "function ", "findIndex": "function ", - "entries": "function ", "keys": "function ", "values": "function ", "Symbol.iterator": "function ", + "entries": "function ", "Symbol.unscopables": "Object {...}", "fill": "function ", "copyWithin": "function ", @@ -392,10 +388,10 @@ "some": "function ", "find": "function ", "findIndex": "function ", - "entries": "function ", "keys": "function ", "values": "function ", "Symbol.iterator": "function ", + "entries": "function ", "Symbol.unscopables": "Object {...}", "fill": "function ", "copyWithin": "function ", diff --git a/deps/chakrashim/core/test/DebuggerCommon/blockScopeBasicLetConstTest.js.dbg.baseline b/deps/chakrashim/core/test/DebuggerCommon/blockScopeBasicLetConstTest.js.dbg.baseline index f01c1410427..9757684b7b0 100644 --- a/deps/chakrashim/core/test/DebuggerCommon/blockScopeBasicLetConstTest.js.dbg.baseline +++ b/deps/chakrashim/core/test/DebuggerCommon/blockScopeBasicLetConstTest.js.dbg.baseline @@ -27,10 +27,8 @@ }, "Symbol.iterator": { "#__proto__": "function ", - "length": "number 0", "name": "string values", - "caller": "object null", - "arguments": "object null" + "length": "number 0" } }, "locals": { diff --git a/deps/chakrashim/core/test/DebuggerCommon/bug_543550.js.dbg.baseline b/deps/chakrashim/core/test/DebuggerCommon/bug_543550.js.dbg.baseline index 6e3954854c6..4799e1587da 100644 --- a/deps/chakrashim/core/test/DebuggerCommon/bug_543550.js.dbg.baseline +++ b/deps/chakrashim/core/test/DebuggerCommon/bug_543550.js.dbg.baseline @@ -21,51 +21,37 @@ "length": "number 0", "prototype": "Object {...}", "Symbol.species": "function function Map() { [native code] }", - "name": "string Map", - "caller": "object null", - "arguments": "object null" + "name": "string Map" }, "clear": { "#__proto__": "function function() {\n [native code]\n}", "length": "number 0", - "name": "string clear", - "caller": "object null", - "arguments": "object null" + "name": "string clear" }, "delete": { "#__proto__": "function function() {\n [native code]\n}", "length": "number 1", - "name": "string delete", - "caller": "object null", - "arguments": "object null" + "name": "string delete" }, "forEach": { "#__proto__": "function function() {\n [native code]\n}", "length": "number 1", - "name": "string forEach", - "caller": "object null", - "arguments": "object null" + "name": "string forEach" }, "get": { "#__proto__": "function function() {\n [native code]\n}", "length": "number 1", - "name": "string get", - "caller": "object null", - "arguments": "object null" + "name": "string get" }, "has": { "#__proto__": "function function() {\n [native code]\n}", "length": "number 1", - "name": "string has", - "caller": "object null", - "arguments": "object null" + "name": "string has" }, "set": { "#__proto__": "function function() {\n [native code]\n}", "length": "number 2", - "name": "string set", - "caller": "object null", - "arguments": "object null" + "name": "string set" }, "size": { "#__proto__": "Error ", @@ -77,30 +63,22 @@ "entries": { "#__proto__": "function function() {\n [native code]\n}", "length": "number 0", - "name": "string entries", - "caller": "object null", - "arguments": "object null" + "name": "string entries" }, "keys": { "#__proto__": "function function() {\n [native code]\n}", "length": "number 0", - "name": "string keys", - "caller": "object null", - "arguments": "object null" + "name": "string keys" }, "values": { "#__proto__": "function function() {\n [native code]\n}", "length": "number 0", - "name": "string values", - "caller": "object null", - "arguments": "object null" + "name": "string values" }, "Symbol.iterator": { "#__proto__": "function function() {\n [native code]\n}", "length": "number 0", - "name": "string entries", - "caller": "object null", - "arguments": "object null" + "name": "string entries" }, "Symbol.toStringTag": "string Map" } diff --git a/deps/chakrashim/core/test/DebuggerCommon/bug_os_2946365.js.dbg.baseline b/deps/chakrashim/core/test/DebuggerCommon/bug_os_2946365.js.dbg.baseline index 309e049a75e..eac17db2eec 100644 --- a/deps/chakrashim/core/test/DebuggerCommon/bug_os_2946365.js.dbg.baseline +++ b/deps/chakrashim/core/test/DebuggerCommon/bug_os_2946365.js.dbg.baseline @@ -1,14 +1,6 @@ [ { "this": { - "foo": { - "#__proto__": "function ", - "prototype": "Object {...}", - "name": "string foo", - "caller": "object null", - "arguments": "Object {...}", - "length": "number 0" - }, "a": { "#__proto__": "Array []", "length": "number 10", @@ -22,6 +14,14 @@ "[7]": "string 8", "[8]": "string 9", "[9]": "string 10" + }, + "foo": { + "#__proto__": "function ", + "prototype": "Object {...}", + "name": "string foo", + "caller": "object null", + "arguments": "Object {...}", + "length": "number 0" } }, "arguments": { @@ -50,24 +50,14 @@ }, "Symbol.iterator": { "#__proto__": "function ", - "length": "number 0", "name": "string values", - "caller": "object null", - "arguments": "object null" + "length": "number 0" } }, "locals": { "x": "undefined undefined" }, "globals": { - "foo": { - "#__proto__": "function ", - "prototype": "Object {...}", - "name": "string foo", - "caller": "object null", - "arguments": "Object {...}", - "length": "number 0" - }, "a": { "#__proto__": "Array []", "length": "number 10", @@ -81,6 +71,14 @@ "[7]": "string 8", "[8]": "string 9", "[9]": "string 10" + }, + "foo": { + "#__proto__": "function ", + "prototype": "Object {...}", + "name": "string foo", + "caller": "object null", + "arguments": "Object {...}", + "length": "number 0" } } } diff --git a/deps/chakrashim/core/test/DebuggerCommon/frames_values_mapES6.js.dbg.baseline b/deps/chakrashim/core/test/DebuggerCommon/frames_values_mapES6.js.dbg.baseline index ac198ca64a3..ad368e2d874 100644 --- a/deps/chakrashim/core/test/DebuggerCommon/frames_values_mapES6.js.dbg.baseline +++ b/deps/chakrashim/core/test/DebuggerCommon/frames_values_mapES6.js.dbg.baseline @@ -22,80 +22,58 @@ "length": "number 0", "prototype": "Object {...}", "Symbol.species": "function ", - "name": "string Map", - "caller": "object null", - "arguments": "object null" + "name": "string Map" }, "clear": { "#__proto__": "function ", "length": "number 0", - "name": "string clear", - "caller": "object null", - "arguments": "object null" + "name": "string clear" }, "delete": { "#__proto__": "function ", "length": "number 1", - "name": "string delete", - "caller": "object null", - "arguments": "object null" + "name": "string delete" }, "forEach": { "#__proto__": "function ", "length": "number 1", - "name": "string forEach", - "caller": "object null", - "arguments": "object null" + "name": "string forEach" }, "get": { "#__proto__": "function ", "length": "number 1", - "name": "string get", - "caller": "object null", - "arguments": "object null" + "name": "string get" }, "has": { "#__proto__": "function ", "length": "number 1", - "name": "string has", - "caller": "object null", - "arguments": "object null" + "name": "string has" }, "set": { "#__proto__": "function ", "length": "number 2", - "name": "string set", - "caller": "object null", - "arguments": "object null" + "name": "string set" }, "size": "number 1", "entries": { "#__proto__": "function ", "length": "number 0", - "name": "string entries", - "caller": "object null", - "arguments": "object null" + "name": "string entries" }, "keys": { "#__proto__": "function ", "length": "number 0", - "name": "string keys", - "caller": "object null", - "arguments": "object null" + "name": "string keys" }, "values": { "#__proto__": "function ", "length": "number 0", - "name": "string values", - "caller": "object null", - "arguments": "object null" + "name": "string values" }, "Symbol.iterator": { "#__proto__": "function ", "length": "number 0", - "name": "string entries", - "caller": "object null", - "arguments": "object null" + "name": "string entries" }, "Symbol.toStringTag": "string Map" }, @@ -188,80 +166,58 @@ "length": "number 0", "prototype": "Object {...}", "Symbol.species": "function ", - "name": "string Map", - "caller": "object null", - "arguments": "object null" + "name": "string Map" }, "clear": { "#__proto__": "function ", "length": "number 0", - "name": "string clear", - "caller": "object null", - "arguments": "object null" + "name": "string clear" }, "delete": { "#__proto__": "function ", "length": "number 1", - "name": "string delete", - "caller": "object null", - "arguments": "object null" + "name": "string delete" }, "forEach": { "#__proto__": "function ", "length": "number 1", - "name": "string forEach", - "caller": "object null", - "arguments": "object null" + "name": "string forEach" }, "get": { "#__proto__": "function ", "length": "number 1", - "name": "string get", - "caller": "object null", - "arguments": "object null" + "name": "string get" }, "has": { "#__proto__": "function ", "length": "number 1", - "name": "string has", - "caller": "object null", - "arguments": "object null" + "name": "string has" }, "set": { "#__proto__": "function ", "length": "number 2", - "name": "string set", - "caller": "object null", - "arguments": "object null" + "name": "string set" }, "size": "number 0", "entries": { "#__proto__": "function ", "length": "number 0", - "name": "string entries", - "caller": "object null", - "arguments": "object null" + "name": "string entries" }, "keys": { "#__proto__": "function ", "length": "number 0", - "name": "string keys", - "caller": "object null", - "arguments": "object null" + "name": "string keys" }, "values": { "#__proto__": "function ", "length": "number 0", - "name": "string values", - "caller": "object null", - "arguments": "object null" + "name": "string values" }, "Symbol.iterator": { "#__proto__": "function ", "length": "number 0", - "name": "string entries", - "caller": "object null", - "arguments": "object null" + "name": "string entries" }, "Symbol.toStringTag": "string Map" }, @@ -292,80 +248,58 @@ "length": "number 0", "prototype": "Object {...}", "Symbol.species": "function ", - "name": "string Map", - "caller": "object null", - "arguments": "object null" + "name": "string Map" }, "clear": { "#__proto__": "function ", "length": "number 0", - "name": "string clear", - "caller": "object null", - "arguments": "object null" + "name": "string clear" }, "delete": { "#__proto__": "function ", "length": "number 1", - "name": "string delete", - "caller": "object null", - "arguments": "object null" + "name": "string delete" }, "forEach": { "#__proto__": "function ", "length": "number 1", - "name": "string forEach", - "caller": "object null", - "arguments": "object null" + "name": "string forEach" }, "get": { "#__proto__": "function ", "length": "number 1", - "name": "string get", - "caller": "object null", - "arguments": "object null" + "name": "string get" }, "has": { "#__proto__": "function ", "length": "number 1", - "name": "string has", - "caller": "object null", - "arguments": "object null" + "name": "string has" }, "set": { "#__proto__": "function ", "length": "number 2", - "name": "string set", - "caller": "object null", - "arguments": "object null" + "name": "string set" }, "size": "number 1", "entries": { "#__proto__": "function ", "length": "number 0", - "name": "string entries", - "caller": "object null", - "arguments": "object null" + "name": "string entries" }, "keys": { "#__proto__": "function ", "length": "number 0", - "name": "string keys", - "caller": "object null", - "arguments": "object null" + "name": "string keys" }, "values": { "#__proto__": "function ", "length": "number 0", - "name": "string values", - "caller": "object null", - "arguments": "object null" + "name": "string values" }, "Symbol.iterator": { "#__proto__": "function ", "length": "number 0", - "name": "string entries", - "caller": "object null", - "arguments": "object null" + "name": "string entries" }, "Symbol.toStringTag": "string Map" }, @@ -458,80 +392,58 @@ "length": "number 0", "prototype": "Object {...}", "Symbol.species": "function ", - "name": "string Map", - "caller": "object null", - "arguments": "object null" + "name": "string Map" }, "clear": { "#__proto__": "function ", "length": "number 0", - "name": "string clear", - "caller": "object null", - "arguments": "object null" + "name": "string clear" }, "delete": { "#__proto__": "function ", "length": "number 1", - "name": "string delete", - "caller": "object null", - "arguments": "object null" + "name": "string delete" }, "forEach": { "#__proto__": "function ", "length": "number 1", - "name": "string forEach", - "caller": "object null", - "arguments": "object null" + "name": "string forEach" }, "get": { "#__proto__": "function ", "length": "number 1", - "name": "string get", - "caller": "object null", - "arguments": "object null" + "name": "string get" }, "has": { "#__proto__": "function ", "length": "number 1", - "name": "string has", - "caller": "object null", - "arguments": "object null" + "name": "string has" }, "set": { "#__proto__": "function ", "length": "number 2", - "name": "string set", - "caller": "object null", - "arguments": "object null" + "name": "string set" }, "size": "number 0", "entries": { "#__proto__": "function ", "length": "number 0", - "name": "string entries", - "caller": "object null", - "arguments": "object null" + "name": "string entries" }, "keys": { "#__proto__": "function ", "length": "number 0", - "name": "string keys", - "caller": "object null", - "arguments": "object null" + "name": "string keys" }, "values": { "#__proto__": "function ", "length": "number 0", - "name": "string values", - "caller": "object null", - "arguments": "object null" + "name": "string values" }, "Symbol.iterator": { "#__proto__": "function ", "length": "number 0", - "name": "string entries", - "caller": "object null", - "arguments": "object null" + "name": "string entries" }, "Symbol.toStringTag": "string Map" }, @@ -539,4 +451,4 @@ } } } -] +] \ No newline at end of file diff --git a/deps/chakrashim/core/test/DebuggerCommon/indexprop.js.dbg.baseline b/deps/chakrashim/core/test/DebuggerCommon/indexprop.js.dbg.baseline index 517bf5cc1ec..c1ad86c45a4 100644 --- a/deps/chakrashim/core/test/DebuggerCommon/indexprop.js.dbg.baseline +++ b/deps/chakrashim/core/test/DebuggerCommon/indexprop.js.dbg.baseline @@ -28,10 +28,8 @@ }, "Symbol.iterator": { "#__proto__": "function ", - "length": "number 0", "name": "string values", - "caller": "object null", - "arguments": "object null" + "length": "number 0" }, "[0]": "string \"arg0\"", "[1]": "string \"arg1\"", @@ -64,14 +62,14 @@ "some": "function ", "find": "function ", "findIndex": "function ", - "entries": "function ", - "keys": "function ", - "values": "function ", - "Symbol.iterator": "function ", "Symbol.unscopables": "Object {...}", "fill": "function ", "copyWithin": "function ", "includes": "function ", + "keys": "function ", + "values": "function ", + "Symbol.iterator": "function ", + "entries": "function ", "length": "number 0" }, "length": "number 8", diff --git a/deps/chakrashim/core/test/DebuggerCommon/step_in_from_interpreted_function_attach.js.dbg.baseline b/deps/chakrashim/core/test/DebuggerCommon/step_in_from_interpreted_function_attach.js.dbg.baseline index ac720d173ef..607cd18ae45 100644 --- a/deps/chakrashim/core/test/DebuggerCommon/step_in_from_interpreted_function_attach.js.dbg.baseline +++ b/deps/chakrashim/core/test/DebuggerCommon/step_in_from_interpreted_function_attach.js.dbg.baseline @@ -74,10 +74,8 @@ }, "Symbol.iterator": { "#__proto__": "function ", - "length": "number 0", "name": "string values", - "caller": "object null", - "arguments": "object null" + "length": "number 0" } }, "[Return value]": "undefined undefined", @@ -166,14 +164,14 @@ "some": "function ", "find": "function ", "findIndex": "function ", - "entries": "function ", - "keys": "function ", - "values": "function ", - "Symbol.iterator": "function ", "Symbol.unscopables": "Object {...}", "fill": "function ", "copyWithin": "function ", "includes": "function ", + "keys": "function ", + "values": "function ", + "Symbol.iterator": "function ", + "entries": "function ", "length": "number 0" }, "length": "number 0" diff --git a/deps/chakrashim/core/test/DebuggerCommon/stringkeyedtypehandler.js.dbg.baseline b/deps/chakrashim/core/test/DebuggerCommon/stringkeyedtypehandler.js.dbg.baseline index f055fbea2e9..e9299169680 100644 --- a/deps/chakrashim/core/test/DebuggerCommon/stringkeyedtypehandler.js.dbg.baseline +++ b/deps/chakrashim/core/test/DebuggerCommon/stringkeyedtypehandler.js.dbg.baseline @@ -27,10 +27,8 @@ }, "Symbol.iterator": { "#__proto__": "function ", - "length": "number 0", "name": "string values", - "caller": "object null", - "arguments": "object null" + "length": "number 0" } }, "locals": { @@ -55,6 +53,9 @@ } }, "globals": { + "o": { + "#__proto__": "Object {...}" + }, "foo": { "#__proto__": "function ", "prototype": "Object {...}", @@ -62,9 +63,6 @@ "caller": "object null", "arguments": "Object {...}", "length": "number 0" - }, - "o": { - "#__proto__": "Object {...}" } } } diff --git a/deps/chakrashim/core/test/DebuggerCommon/symbols.js.dbg.baseline b/deps/chakrashim/core/test/DebuggerCommon/symbols.js.dbg.baseline index 78007ac6c4b..2d6a68fb13a 100644 --- a/deps/chakrashim/core/test/DebuggerCommon/symbols.js.dbg.baseline +++ b/deps/chakrashim/core/test/DebuggerCommon/symbols.js.dbg.baseline @@ -32,80 +32,58 @@ "is": "function ", "assign": "function ", "values": "function ", - "entries": "function ", - "caller": "object null", - "arguments": "object null" + "entries": "function " }, "hasOwnProperty": { "#__proto__": "function ", "length": "number 1", - "name": "string hasOwnProperty", - "caller": "object null", - "arguments": "object null" + "name": "string hasOwnProperty" }, "propertyIsEnumerable": { "#__proto__": "function ", "length": "number 1", - "name": "string ", - "caller": "object null", - "arguments": "object null" + "name": "string " }, "isPrototypeOf": { "#__proto__": "function ", "length": "number 1", - "name": "string isPrototypeOf", - "caller": "object null", - "arguments": "object null" + "name": "string isPrototypeOf" }, "toLocaleString": { "#__proto__": "function ", "length": "number 0", - "name": "string toLocaleString", - "caller": "object null", - "arguments": "object null" + "name": "string toLocaleString" }, "toString": { "#__proto__": "function ", "length": "number 0", - "name": "string toString", - "caller": "object null", - "arguments": "object null" + "name": "string toString" }, "valueOf": { "#__proto__": "function ", "length": "number 0", - "name": "string valueOf", - "caller": "object null", - "arguments": "object null" + "name": "string valueOf" }, "#__proto__": "object null", "__defineGetter__": { "#__proto__": "function ", "length": "number 2", - "name": "string __defineGetter__", - "caller": "object null", - "arguments": "object null" + "name": "string __defineGetter__" }, "__defineSetter__": { "#__proto__": "function ", "length": "number 2", - "name": "string __defineSetter__", - "caller": "object null", - "arguments": "object null" + "name": "string __defineSetter__" }, "__lookupGetter__": { "#__proto__": "function ", "length": "number 1", - "name": "string __lookupGetter__", - "caller": "object null", - "arguments": "object null" + "name": "string __lookupGetter__" }, "__lookupSetter__": { "#__proto__": "function ", "length": "number 1", - "name": "string __lookupSetter__", - "caller": "object null", - "arguments": "object null" + "name": "string __lookupSetter__" } }, "constructor": { @@ -142,19 +120,13 @@ "for": { "#__proto__": "function ", "length": "number 1", - "name": "string for", - "caller": "object null", - "arguments": "object null" + "name": "string for" }, "keyFor": { "#__proto__": "function ", "length": "number 1", - "name": "string keyFor", - "caller": "object null", - "arguments": "object null" - }, - "caller": "object null", - "arguments": "object null" + "name": "string keyFor" + } }, "Symbol.toStringTag": "string Symbol", "valueOf": { @@ -172,9 +144,7 @@ "arguments": "Error " }, "length": "number 0", - "name": "string valueOf", - "caller": "object null", - "arguments": "object null" + "name": "string valueOf" }, "toString": { "#__proto__": { @@ -191,9 +161,7 @@ "arguments": "Error " }, "length": "number 0", - "name": "string toString", - "caller": "object null", - "arguments": "object null" + "name": "string toString" }, "Symbol.toPrimitive": { "#__proto__": { @@ -210,9 +178,7 @@ "arguments": "Error " }, "length": "number 1", - "name": "string ", - "caller": "object null", - "arguments": "object null" + "name": "string " } } }, diff --git a/deps/chakrashim/core/test/DebuggerCommon/targeted.js.dbg.baseline b/deps/chakrashim/core/test/DebuggerCommon/targeted.js.dbg.baseline index b6a6de90495..3d8d88b3cb9 100644 --- a/deps/chakrashim/core/test/DebuggerCommon/targeted.js.dbg.baseline +++ b/deps/chakrashim/core/test/DebuggerCommon/targeted.js.dbg.baseline @@ -39,6 +39,7 @@ }, { "this": { + "i": "number 0", "g": { "#__proto__": "function ", "prototype": "Object {...}", @@ -71,7 +72,6 @@ "arguments": "object null", "length": "number 0" }, - "i": "number 0", "d": "number 7" }, "arguments": { @@ -100,10 +100,8 @@ }, "Symbol.iterator": { "#__proto__": "function ", - "length": "number 0", "name": "string values", - "caller": "object null", - "arguments": "object null" + "length": "number 0" } }, "locals": { @@ -132,6 +130,7 @@ } }, "globals": { + "i": "number 0", "g": { "#__proto__": "function ", "prototype": "Object {...}", @@ -164,7 +163,6 @@ "arguments": "object null", "length": "number 0" }, - "i": "number 0", "d": "number 7" } }, @@ -208,6 +206,7 @@ }, { "this": { + "i": "number 1", "g": { "#__proto__": "function ", "prototype": "Object {...}", @@ -240,7 +239,6 @@ "arguments": "object null", "length": "number 0" }, - "i": "number 1", "d": "number 7" }, "arguments": { @@ -269,10 +267,8 @@ }, "Symbol.iterator": { "#__proto__": "function ", - "length": "number 0", "name": "string values", - "caller": "object null", - "arguments": "object null" + "length": "number 0" } }, "locals": { @@ -301,6 +297,7 @@ } }, "globals": { + "i": "number 1", "g": { "#__proto__": "function ", "prototype": "Object {...}", @@ -333,7 +330,6 @@ "arguments": "object null", "length": "number 0" }, - "i": "number 1", "d": "number 7" } }, @@ -377,6 +373,7 @@ }, { "this": { + "i": "number 2", "g": { "#__proto__": "function ", "prototype": "Object {...}", @@ -409,7 +406,6 @@ "arguments": "object null", "length": "number 0" }, - "i": "number 2", "d": "number 7" }, "arguments": { @@ -438,10 +434,8 @@ }, "Symbol.iterator": { "#__proto__": "function ", - "length": "number 0", "name": "string values", - "caller": "object null", - "arguments": "object null" + "length": "number 0" } }, "locals": { @@ -470,6 +464,7 @@ } }, "globals": { + "i": "number 2", "g": { "#__proto__": "function ", "prototype": "Object {...}", @@ -502,7 +497,6 @@ "arguments": "object null", "length": "number 0" }, - "i": "number 2", "d": "number 7" } }, @@ -546,6 +540,7 @@ }, { "this": { + "i": "number 3", "g": { "#__proto__": "function ", "prototype": "Object {...}", @@ -578,7 +573,6 @@ "arguments": "object null", "length": "number 0" }, - "i": "number 3", "d": "number 7" }, "arguments": { @@ -607,10 +601,8 @@ }, "Symbol.iterator": { "#__proto__": "function ", - "length": "number 0", "name": "string values", - "caller": "object null", - "arguments": "object null" + "length": "number 0" } }, "locals": { @@ -639,6 +631,7 @@ } }, "globals": { + "i": "number 3", "g": { "#__proto__": "function ", "prototype": "Object {...}", @@ -671,7 +664,6 @@ "arguments": "object null", "length": "number 0" }, - "i": "number 3", "d": "number 7" } }, @@ -715,6 +707,7 @@ }, { "this": { + "i": "number 4", "g": { "#__proto__": "function ", "prototype": "Object {...}", @@ -747,7 +740,6 @@ "arguments": "object null", "length": "number 0" }, - "i": "number 4", "d": "number 7" }, "arguments": { @@ -776,10 +768,8 @@ }, "Symbol.iterator": { "#__proto__": "function ", - "length": "number 0", "name": "string values", - "caller": "object null", - "arguments": "object null" + "length": "number 0" } }, "locals": { @@ -808,6 +798,7 @@ } }, "globals": { + "i": "number 4", "g": { "#__proto__": "function ", "prototype": "Object {...}", @@ -840,17 +831,16 @@ "arguments": "object null", "length": "number 0" }, - "i": "number 4", "d": "number 7" } }, { "this": { + "i": "number 5", "g": "function ", "f": "function ", "g1": "function ", "f1": "function ", - "i": "number 5", "d": "number 7" }, "locals": { @@ -864,21 +854,21 @@ } }, "globals": { + "i": "number 5", "g": "function ", "f": "function ", "g1": "function ", "f1": "function ", - "i": "number 5", "d": "number 7" } }, { "this": { + "i": "number 5", "g": "function ", "f": "function ", "g1": "function ", "f1": "function ", - "i": "number 5", "d": "number 7" }, "locals": { @@ -892,11 +882,11 @@ } }, "globals": { + "i": "number 5", "g": "function ", "f": "function ", "g1": "function ", "f1": "function ", - "i": "number 5", "d": "number 7" } } diff --git a/deps/chakrashim/core/test/Function/builtinFuncHasOwnPropCallerArguments.js b/deps/chakrashim/core/test/Function/builtinFuncHasOwnPropCallerArguments.js new file mode 100644 index 00000000000..9740945f43c --- /dev/null +++ b/deps/chakrashim/core/test/Function/builtinFuncHasOwnPropCallerArguments.js @@ -0,0 +1,96 @@ +//------------------------------------------------------------------------------------------------------- +// Copyright (C) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. +//------------------------------------------------------------------------------------------------------- + +/* + +See: + gh-249 + OS#14101048 + +According to #sec-forbidden-extensions +For all built-in functions `func`, `func.hasOwnProperty('arguments')` and `func.hasOwnProperty('caller')` must return false. + + Array.prototype.push.hasOwnProperty('arguments') // === false + Array.prototype.push.hasOwnProperty('caller') // === false + +*/ + +WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js"); + +let isVerbose = WScript.Arguments[0] != "summary"; + +let global = this; + +function getFunctions(ns) { + return Object.getOwnPropertyNames(ns) + .filter(x => { + // print(x); + if (['caller', 'arguments'].includes(x)) { + return false; + } + return typeof ns[x] === 'function' + }) + .sort() + .map(x => { + return [x, ns[x]]; + }) +} + +let builtins = { + "global": getFunctions(global).filter(x => ![ + 'getFunctions', + ].includes(x[0])), + + "Object.prototype": getFunctions(Object.prototype), + "String.prototype": getFunctions(String.prototype), + "RegExp.prototype": getFunctions(RegExp.prototype), + "Function.prototype": getFunctions(Function.prototype), + "Array.prototype": getFunctions(Array.prototype), + "Uint8Array.prototype": getFunctions(Uint8Array.prototype), + "Uint8ClampedArray.prototype": getFunctions(Uint8ClampedArray.prototype), + "Uint16Array.prototype": getFunctions(Uint16Array.prototype), + "Uint32Array.prototype": getFunctions(Uint32Array.prototype), + "Int8Array.prototype": getFunctions(Int8Array.prototype), + "Int16Array.prototype": getFunctions(Int16Array.prototype), + "Int32Array.prototype": getFunctions(Int32Array.prototype), +}; + +if (typeof Intl !== "undefined") { + builtins["Intl"] = getFunctions(Intl); + builtins["Intl.Collator"] = getFunctions(Intl.Collator); + builtins["Intl.Collator.prototype"] = getFunctions(Intl.Collator.prototype); + builtins["Intl.DateTimeFormat"] = getFunctions(Intl.DateTimeFormat); + builtins["Intl.DateTimeFormat.prototype"] = getFunctions(Intl.DateTimeFormat.prototype); + builtins["Intl.NumberFormat"] = getFunctions(Intl.NumberFormat); + builtins["Intl.NumberFormat.prototype"] = getFunctions(Intl.NumberFormat.prototype); +} + +var tests = [ + { + name: "builtin functions hasOwnProperty('arguments'|'caller') === false", + body: function () { + function test(f, p, name) { + if (isVerbose) { + print(`Checking: ${name}.hasOwnProperty('${p}') === false`); + } + assert.areEqual(false, f.hasOwnProperty(p), `Expected (${name}.hasOwnProperty('${p}') === false) but actually true`); + } + + for (let ns in builtins) { + let functions = builtins[ns]; + for (let f of functions) { + let funcName = f[0]; + let func = f[1]; + let fullName = `${ns}.${funcName}`; + + test(func, 'arguments', fullName); + test(func, 'caller', fullName); + } + } + } + } +]; + +testRunner.runTests(tests, { verbose: isVerbose }); diff --git a/deps/chakrashim/core/test/Function/rlexe.xml b/deps/chakrashim/core/test/Function/rlexe.xml index 627ea0f989c..d37b6487b19 100644 --- a/deps/chakrashim/core/test/Function/rlexe.xml +++ b/deps/chakrashim/core/test/Function/rlexe.xml @@ -79,6 +79,12 @@ bind.baseline + + + builtinFuncHasOwnPropCallerArguments.js + -args summary -endargs + + call1.js diff --git a/deps/chakrashim/core/test/Function/typeErrorAccessor.baseline b/deps/chakrashim/core/test/Function/typeErrorAccessor.baseline index b7152bdbd55..92be99230fa 100644 --- a/deps/chakrashim/core/test/Function/typeErrorAccessor.baseline +++ b/deps/chakrashim/core/test/Function/typeErrorAccessor.baseline @@ -1,27 +1,13 @@ ***************** getter ***************** length = 0 -[object Object] -undefined -undefined -V:0, W:false, E:false, C:true, get:false, set:false +object, undefined, undefined, true +value:0, writable:false, enumerable:false, configurable:true, get:false, set:false ***************** g.caller ***************** -[object Object] -function() { - [native code] -} -function() { - [native code] -} -V:undefined, W:undefined, E:false, C:false, get:true, set:true +object, function, function, true +value:undefined, writable:undefined, enumerable:false, configurable:true, get:true, set:true ***************** g.arguments ***************** -[object Object] -function() { - [native code] -} -function() { - [native code] -} -V:undefined, W:undefined, E:false, C:false, get:true, set:true +object, function, function, true +value:undefined, writable:undefined, enumerable:false, configurable:true, get:true, set:true ***************** try to set/get the caller/arguments ***************** Set caller passed Get caller passed diff --git a/deps/chakrashim/core/test/Function/typeErrorAccessor.js b/deps/chakrashim/core/test/Function/typeErrorAccessor.js index be1a37cff45..526e3cf4051 100644 --- a/deps/chakrashim/core/test/Function/typeErrorAccessor.js +++ b/deps/chakrashim/core/test/Function/typeErrorAccessor.js @@ -3,14 +3,12 @@ // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. //------------------------------------------------------------------------------------------------------- -function write(v) { WScript.Echo(v + ""); } +function write(v) { print(v + ""); } function printDesc(d) { - write(d); - write(d.set); - write(d.get); + write(`${typeof d}, ${typeof d.set}, ${typeof d.get}, ${d.set === d.get}`); - var s = "V:" + d.value + ", W:" + d.writable + ", E:" + d.enumerable + ", C:" + d.configurable; + var s = "value:" + d.value + ", writable:" + d.writable + ", enumerable:" + d.enumerable + ", configurable:" + d.configurable; s += ", get:" + d.hasOwnProperty('get') + ", set:" + d.hasOwnProperty('set'); write(s); diff --git a/deps/chakrashim/core/test/es6/ES6RestrictedProperties.js b/deps/chakrashim/core/test/es6/ES6RestrictedProperties.js index b375515a6f4..aae72b84238 100644 --- a/deps/chakrashim/core/test/es6/ES6RestrictedProperties.js +++ b/deps/chakrashim/core/test/es6/ES6RestrictedProperties.js @@ -9,6 +9,10 @@ WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js"); function verifyAttributes(obj, prop, attribs, name) { var p = Object.getOwnPropertyDescriptor(obj, prop); + if (typeof p === "undefined") { + assert.fail("FAIL: propertyDescriptor is undefined"); + return; + } assert.areNotEqual(undefined, p, name + " does not have property named " + prop); @@ -18,12 +22,18 @@ function verifyAttributes(obj, prop, attribs, name) { } function verifyHasRestrictedOwnProperties(obj, name) { - assert.isTrue(obj.hasOwnProperty('caller'), name + " reports that it has own property 'caller'") - assert.isTrue(obj.hasOwnProperty('arguments'), name + " reports that it has own property 'arguments'") + // NOTE: Results for this test method differ from other engines, but there are no regressions from previous ch behavior: + // NOTE: * (sm) treats sloppy-mode functions like strict-mode functions for caller/arguments + // NOTE: * (sm, v8, jsc) treat object-literal functions like strict-mode functions for caller/arguments + + // NOTE: object-literal functions behavior more like strict-mode functions in other engines (sm, v8, jsc) + // NOTE: sm additionally seems to make sloppy-mode functions behave like strict-mode functions for caller/arguments + assert.isTrue(obj.hasOwnProperty('caller'), name + " reports (hasOwnProperty('caller')===false)") + assert.isTrue(obj.hasOwnProperty('arguments'), name + " reports (hasOwnProperty('arguments')===false)") var names = Object.getOwnPropertyNames(obj); - assert.areNotEqual(-1, names.findIndex((e) => { return e === 'arguments'; }), name + " has 'arguments' own property"); - assert.areNotEqual(-1, names.findIndex((e) => { return e === 'caller'; }), name + " has 'caller' own property"); + assert.areNotEqual(-1, names.findIndex((e) => { return e === 'arguments'; }), name + " has 'arguments' own property (as reported by Object.getOwnPropertyNames)"); + assert.areNotEqual(-1, names.findIndex((e) => { return e === 'caller'; }), name + " has 'caller' own property (as reported by Object.getOwnPropertyNames)"); verifyAttributes(obj, 'caller', { writable: false, enumerable: false, configurable: false }, name); assert.isFalse(obj.propertyIsEnumerable('caller'), name + " says 'caller' property is not enumerable"); @@ -33,21 +43,28 @@ function verifyHasRestrictedOwnProperties(obj, name) { assert.areEqual(null, obj.caller, name + " says 'caller' property is null") assert.areEqual(null, obj.arguments, name + " says 'arguments' property is null") + // NOTE: other engines throw here for object-literal function assert.doesNotThrow(function() { obj.caller = 'something'; }, name + " has 'caller' property which can't be assigned to"); assert.doesNotThrow(function() { obj.arguments = 'something'; }, name + " has 'arguments' property which can't be assigned to"); + // NOTE: sm does not throw for non-strict function `obj` assert.throws(function() { 'use strict'; obj.caller = 'something'; }, TypeError, name + " has 'caller' own property but it is not configurable so we will throw in strict mode", "Assignment to read-only properties is not allowed in strict mode"); assert.throws(function() { 'use strict'; obj.arguments = 'something'; }, TypeError, name + " has 'arguments' own property but it is not configurable so we will throw in strict mode", "Assignment to read-only properties is not allowed in strict mode"); + // NOTE: other engines throw for object-literal function assert.areEqual(null, obj.caller, name + " says 'caller' property is null") assert.areEqual(null, obj.arguments, name + " says 'arguments' property is null") + // NOTE: other engines fail object-literal function (sm also fails non-strict function) assert.throws(function() { Object.defineProperty(obj, 'arguments', { value: 123 }); }, TypeError, name + " has 'arguments' property as non-writable, non-configurable", "Cannot modify non-writable property 'arguments'"); assert.throws(function() { Object.defineProperty(obj, 'caller', { value: 123 }); }, TypeError, name + " has 'caller' property as non-writable, non-configurable", "Cannot modify non-writable property 'caller'"); + // NOTE: other engines: the above defineProperty makes the following not fail unless the above lines are commented-out because the above do not throw and therefore actually do the defineProperty) + // NOTE: other engines fail object-literal function (sm also fails non-strict function) assert.isFalse(delete obj.arguments, name + " has 'arguments' property as non-configurable so delete returns false"); assert.isFalse(delete obj.caller, name + " has 'caller' property as non-configurable so delete returns false"); + // NOTE: other engines fail object-literal function (sm also fails non-strict function) assert.throws(function() { 'use strict'; delete obj.caller; }, TypeError, name + " has 'caller' own property but it is not configurable so we will throw in strict mode", "Calling delete on 'caller' is not allowed in strict mode"); assert.throws(function() { 'use strict'; delete obj.arguments; }, TypeError, name + " has 'arguments' own property but it is not configurable so we will throw in strict mode", "Calling delete on 'arguments' is not allowed in strict mode"); } @@ -127,61 +144,53 @@ var tests = [ var p = Object.getOwnPropertyDescriptor(obj, 'caller'); assert.isFalse(p.enumerable, "Function.prototype function has 'caller' own property which is not enumerable"); - assert.isFalse(p.configurable, "Function.prototype function has 'caller' own property which is not configurable"); + assert.isTrue(p.configurable, "Function.prototype function has 'caller' own property which is configurable"); assert.isFalse(obj.propertyIsEnumerable('caller'), "Function.prototype says 'caller' property is not enumerable"); assert.areEqual('function', typeof p.get, "Function.prototype['caller'] has get accessor function"); assert.areEqual('function', typeof p.set, "Function.prototype['caller'] has set accessor function"); assert.throws(function() { p.get(); }, TypeError, "Function.prototype['caller'] has get accessor which throws"); assert.throws(function() { p.set(); }, TypeError, "Function.prototype['caller'] has set accessor which throws"); - assert.isTrue(p.get === p.set, "Function.prototype returns the same ThrowTypeError function for get/set accessor of 'caller' property"); var p2 = Object.getOwnPropertyDescriptor(obj, 'arguments'); assert.isFalse(p2.enumerable, "Function.prototype function has 'arguments' own property which is not enumerable"); - assert.isFalse(p2.configurable, "Function.prototype function has 'arguments' own property which is not configurable"); + assert.isTrue(p2.configurable, "Function.prototype function has 'arguments' own property which is configurable"); assert.isFalse(obj.propertyIsEnumerable('arguments'), "Function.prototype says 'arguments' property is not enumerable"); assert.areEqual('function', typeof p2.get, "Function.prototype['arguments'] has get accessor function"); assert.areEqual('function', typeof p2.set, "Function.prototype['arguments'] has set accessor function"); assert.throws(function() { p2.get(); }, TypeError, "Function.prototype['arguments'] has get accessor which throws"); assert.throws(function() { p2.set(); }, TypeError, "Function.prototype['arguments'] has set accessor which throws"); - assert.isTrue(p2.get === p2.set, "Function.prototype returns the same ThrowTypeError function for get/set accessor of 'arguments' property"); + // NOTE: sm fails these tests + assert.isTrue(p.get === p.set, "Function.prototype returns the same ThrowTypeError function for get/set accessor of 'caller' property"); + assert.isTrue(p2.get === p2.set, "Function.prototype returns the same ThrowTypeError function for get/set accessor of 'arguments' property"); assert.isTrue(p.get === p2.get, "Function.prototype returns the same ThrowTypeError function for accessor of both 'arguments' and 'caller' properties"); var names = Object.getOwnPropertyNames(obj); assert.areNotEqual(-1, names.findIndex((e) => { return e === 'arguments'; }), "Function.prototype has 'arguments' own property"); assert.areNotEqual(-1, names.findIndex((e) => { return e === 'caller'; }), "Function.prototype has 'caller' own property"); + // NOTE: sm fails these tests assert.throws(function() { obj.caller; }, TypeError, "Function.prototype throws on access to 'caller' property", "'arguments', 'callee' and 'caller' are restricted function properties and cannot be accessed in this context"); assert.throws(function() { obj.arguments; }, TypeError, "Function.prototype throws on access to 'arguments' property", "'arguments', 'callee' and 'caller' are restricted function properties and cannot be accessed in this context"); - assert.throws(function() { obj.caller = 'something'; }, TypeError, "Function.prototype throws trying to assign to 'caller' property", "'arguments', 'callee' and 'caller' are restricted function properties and cannot be accessed in this context"); assert.throws(function() { obj.arguments = 'something'; }, TypeError, "Function.prototype throws trying to assign to 'arguments' property", "'arguments', 'callee' and 'caller' are restricted function properties and cannot be accessed in this context"); - // TODO: These descriptors should have configurable set to true so remaining asserts in this test should actually succeed - assert.throws(function() { Object.defineProperty(obj, 'arguments', { value: 123 }); }, TypeError, "Function.prototype has 'arguments' property as non-configurable", "Cannot redefine non-configurable property 'arguments'"); - assert.throws(function() { Object.defineProperty(obj, 'caller', { value: 123 }); }, TypeError, "Function.prototype has 'caller' property as non-configurable", "Cannot redefine non-configurable property 'caller'"); - - assert.isFalse(delete obj.arguments, "Function.prototype has 'arguments' property as non-configurable so delete returns false"); - assert.isFalse(delete obj.caller, "Function.prototype has 'caller' property as non-configurable so delete returns false"); - - assert.throws(function() { 'use strict'; delete obj.caller; }, TypeError, "Function.prototype has 'caller' own property but it is not configurable so we will throw in strict mode", "Calling delete on 'caller' is not allowed in strict mode"); - assert.throws(function() { 'use strict'; delete obj.arguments; }, TypeError, "Function.prototype has 'arguments' own property but it is not configurable so we will throw in strict mode", "Calling delete on 'arguments' is not allowed in strict mode"); } }, { name: "Restricted properties of non-strict function", body: function () { - function obj() {}; + function nonStrictFunc() {}; - verifyHasRestrictedOwnProperties(obj, "Non-strict function"); + verifyHasRestrictedOwnProperties(nonStrictFunc, "Non-strict function"); } }, { name: "Restricted properties of strict function", body: function () { - function foo() { 'use strict'; }; + function strictFunc() { 'use strict'; }; - verifyDoesNotHaveRestrictedOwnProperties(foo, "Strict function"); + verifyDoesNotHaveRestrictedOwnProperties(strictFunc, "Strict function"); } }, { @@ -371,6 +380,26 @@ var tests = [ verifyDoesNotHaveRestrictedOwnProperties(obj.func, "Object-literal strict-mode function"); } }, + { + name: "Destructive operations on Function.prototype", // Destructive! Must be the final test! + body: function() { + var obj = Function.prototype; + + assert.doesNotThrow(function() { Object.defineProperty(obj, 'arguments', { value: 42 }); }, "Allow redefining configurable property 'arguments'"); + assert.doesNotThrow(function() { Object.defineProperty(obj, 'caller', { value: 123 }); }, "Allow redefining configurable property 'caller'"); + assert.areEqual(obj.arguments, 42); + assert.areEqual(obj.caller, 123); + + assert.doesNotThrow(function() { 'use strict'; assert.isTrue(delete obj.caller); }, "Function.prototype has 'caller' own property as configurable, so delete is true; strict mode has no effect"); + assert.doesNotThrow(function() { 'use strict'; assert.isTrue(delete obj.arguments); }, "Function.prototype has 'arguments' own property as configurable, so delete is true; strict mode has no effect"); + assert.areEqual(obj.arguments, undefined); + assert.areEqual(obj.caller, undefined); + + // These should succeed even after the first delete above (normal delete behavior) + assert.isTrue(delete obj.arguments, "Function.prototype has 'arguments' property as configurable so delete returns true (even after first delete)"); + assert.isTrue(delete obj.caller, "Function.prototype has 'caller' property as configurable so delete returns true (even after first delete)"); + } + }, ]; testRunner.runTests(tests, { verbose: WScript.Arguments[0] != "summary" }); diff --git a/deps/chakrashim/core/test/es6/function.name.js b/deps/chakrashim/core/test/es6/function.name.js index 016db3f3f36..4805e91a2da 100644 --- a/deps/chakrashim/core/test/es6/function.name.js +++ b/deps/chakrashim/core/test/es6/function.name.js @@ -86,7 +86,7 @@ var tests = [ assert.areEqual("SetTimeout",WScript.SetTimeout.name,"check to make sure external functions are supported"); assert.areEqual("ClearTimeout",WScript.ClearTimeout.name,"check to make sure external functions are supported"); - assert.areEqual("prototype,name,caller,arguments",Object.getOwnPropertyNames(WScript.Quit).toString(),"Check to make sure name is exposed"); + assert.areEqual("prototype,name",Object.getOwnPropertyNames(WScript.Quit).toString(),"Check to make sure name is exposed"); //Bug 639652 var a = WScript.Echo.toString();