haikuwebkit/LayoutTests/inspector/model/remote-object-get-propertie...

611 lines
9.6 KiB
Plaintext
Raw Permalink Normal View History

Web Inspector: Expanding event objects in console shows undefined for most values, it should have real values https://bugs.webkit.org/show_bug.cgi?id=137306 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-01-20 Reviewed by Timothy Hatcher. Source/JavaScriptCore: Provide another optional parameter to getProperties, to gather a list of all own and getter properties. * inspector/InjectedScript.cpp: (Inspector::InjectedScript::getProperties): * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getProperties): * inspector/agents/InspectorRuntimeAgent.h: * inspector/protocol/Runtime.json: Source/WebInspectorUI: When first expanding an object, show all the object's own properties and any getter properties that may be on its prototype chain. Now, we only fetch own properties, for __proto__ properties. * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.prototype.getOwnProperties): (WebInspector.RemoteObject.prototype.getOwnAndGetterProperties): (WebInspector.RemoteObject.prototype.getAllProperties): (WebInspector.RemoteObject.prototype.get hasChildren): Deleted. * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.ObjectPropertiesSection): (WebInspector.ObjectPropertiesSection.prototype.update): (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate): LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: Added. * inspector/model/remote-object-get-properties.html: Added. Canonical link: https://commits.webkit.org/158679@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178768 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-01-21 00:34:57 +00:00
-----------------------------------------------------
EXPRESSION: window.simpleObject
type: object
description: Object
OWN PROPERTIES:
a
b
__proto__
Web Inspector: Make Getter/Setter RemoteObject property and ObjectPreview handling consistent https://bugs.webkit.org/show_bug.cgi?id=141587 Reviewed by Timothy Hatcher. Source/JavaScriptCore: Convert getProperties(ownAndGetterProperties) to getDisplayableProperties(). Mark PropertyDescriptors that are presumed to be native getters / bindings separately so that the frontend may display them differently. * inspector/InjectedScript.cpp: (Inspector::InjectedScript::getProperties): (Inspector::InjectedScript::getDisplayableProperties): * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getProperties): (Inspector::InspectorRuntimeAgent::getDisplayableProperties): * inspector/agents/InspectorRuntimeAgent.h: * inspector/protocol/Runtime.json: Source/WebInspectorUI: * UserInterface/Models/CallFrame.js: (WebInspector.CallFrame.prototype.collectScopeChainVariableNames): * UserInterface/Models/PropertyDescriptor.js: (WebInspector.PropertyDescriptor.prototype.get nativeGetter): * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.fromPayload): (WebInspector.RemoteObject.prototype.getOwnPropertyDescriptors): (WebInspector.RemoteObject.prototype.getAllPropertyDescriptors): (WebInspector.RemoteObject.prototype.getDisplayablePropertyDescriptors): (WebInspector.RemoteObject.prototype._getPropertyDescriptors): (WebInspector.RemoteObject.prototype.if): (WebInspector.RemoteObject.prototype.deprecatedGetOwnProperties): (WebInspector.RemoteObject.prototype.deprecatedGetAllProperties): (WebInspector.RemoteObject.prototype._deprecatedGetProperties): (WebInspector.RemoteObject.prototype.getOwnAndGetterPropertyDescriptors): Deleted. (WebInspector.RemoteObject.prototype.callback): Deleted. (WebInspector.RemoteObject.prototype.getOwnProperties): Deleted. (WebInspector.RemoteObject.prototype.getOwnAndGetterProperties): Deleted. (WebInspector.RemoteObject.prototype.getAllProperties): Deleted. (WebInspector.RemoteObject.prototype.set else): Deleted. * UserInterface/Views/ConsoleMessageImpl.js: (WebInspector.ConsoleMessageImpl.prototype._formatParameterAsArray): * UserInterface/Views/DOMNodeDetailsSidebarPanel.js: (WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshProperties.nodePrototypesReady): * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.ObjectPropertiesSection.prototype.update): (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate): * UserInterface/Views/ObjectTreePropertyTreeElement.js: (WebInspector.ObjectTreePropertyTreeElement.prototype.): (WebInspector.ObjectTreePropertyTreeElement.prototype): * UserInterface/Views/ObjectTreeView.js: (WebInspector.ObjectTreeView.prototype.update): LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: * inspector/model/remote-object-get-properties.html: Canonical link: https://commits.webkit.org/160009@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180594 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-02-25 00:31:42 +00:00
DISPLAYABLE PROPERTIES:
Web Inspector: Expanding event objects in console shows undefined for most values, it should have real values https://bugs.webkit.org/show_bug.cgi?id=137306 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-01-20 Reviewed by Timothy Hatcher. Source/JavaScriptCore: Provide another optional parameter to getProperties, to gather a list of all own and getter properties. * inspector/InjectedScript.cpp: (Inspector::InjectedScript::getProperties): * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getProperties): * inspector/agents/InspectorRuntimeAgent.h: * inspector/protocol/Runtime.json: Source/WebInspectorUI: When first expanding an object, show all the object's own properties and any getter properties that may be on its prototype chain. Now, we only fetch own properties, for __proto__ properties. * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.prototype.getOwnProperties): (WebInspector.RemoteObject.prototype.getOwnAndGetterProperties): (WebInspector.RemoteObject.prototype.getAllProperties): (WebInspector.RemoteObject.prototype.get hasChildren): Deleted. * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.ObjectPropertiesSection): (WebInspector.ObjectPropertiesSection.prototype.update): (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate): LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: Added. * inspector/model/remote-object-get-properties.html: Added. Canonical link: https://commits.webkit.org/158679@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178768 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-01-21 00:34:57 +00:00
a
b
__proto__
ALL PROPERTIES:
a
b
toString
toLocaleString
valueOf
hasOwnProperty
propertyIsEnumerable
isPrototypeOf
__defineGetter__
__defineSetter__
__lookupGetter__
__lookupSetter__
constructor
__proto__
-----------------------------------------------------
-----------------------------------------------------
EXPRESSION: window.simpleArray
type: object
subtype: array
description: Array
OWN PROPERTIES:
0
1
2
__proto__
DISPLAYABLE PROPERTIES:
0
1
2
__proto__
ALL PROPERTIES:
0
1
2
length
toString
values
toLocaleString
concat
fill
join
pop
push
reverse
shift
slice
sort
splice
unshift
every
forEach
some
indexOf
lastIndexOf
filter
flat
flatMap
reduce
reduceRight
map
keys
[JSC] Introduce JSArrayIterator https://bugs.webkit.org/show_bug.cgi?id=204043 Reviewed by Yusuke Suzuki. JSTests: * stress/array-iterator-materialize-at-osr-exit.js: Added. (shouldBe): (test): * stress/array-iterator-materialize-one-path.js: Added. (shouldBe): (test): * stress/array-iterator-materialize.js: Added. (shouldBe): (test): * stress/array-iterator-sinking.js: Added. (shouldBe): (test): * stress/array-iterators-next-error-messages.js: (catch): * stress/array-iterators-next-with-call.js: * stress/for-of-iteration.js: Added. (shouldBe): (test1): (test2): (test3): * stress/typedarray-functions-with-neutered.js: (checkProtoFunc): Source/JavaScriptCore: This patch introduces JSArrayIterator that changes the iterator object from a JSFinalObject to an InternalFieldsObject. This makes accessing it much easier from C++ code and makes the iterator object smaller. It also means that the JS code for the next function is much simpler and can *almost* be inlined without shenanigans. As part of this patch the keys/values/entries functions have been converted to C++ with intrinsics since that's slightly more efficient in the LLInt/Baseline. Lastly, this patch also add a custom ISOSubspace for JSArrayIterator objects. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * builtins/ArrayIteratorPrototype.js: (next): (globalPrivate.arrayIteratorNextHelper): (globalPrivate.arrayIteratorValueNext): Deleted. (globalPrivate.arrayIteratorKeyNext): Deleted. (globalPrivate.arrayIteratorKeyValueNext): Deleted. * builtins/ArrayPrototype.js: (globalPrivate.ArrayIterator): Deleted. (values): Deleted. (keys): Deleted. (entries): Deleted. * builtins/TypedArrayPrototype.js: (values): Deleted. (keys): Deleted. (entries): Deleted. * bytecode/BytecodeIntrinsicRegistry.cpp: (JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry): * bytecode/BytecodeIntrinsicRegistry.h: * bytecompiler/BytecodeGenerator.h: (JSC::BytecodeGenerator::emitIsArrayIterator): * bytecompiler/NodesCodegen.cpp: (JSC::arrayIteratorInternalFieldIndex): (JSC::BytecodeIntrinsicNode::emit_intrinsic_getArrayIteratorInternalField): (JSC::BytecodeIntrinsicNode::emit_intrinsic_putArrayIteratorInternalField): (JSC::BytecodeIntrinsicNode::emit_intrinsic_isGenerator): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isAsyncGenerator): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isJSArray): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isPromise): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isProxyObject): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isRegExpObject): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isObject): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isDerivedArray): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isMap): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isSet): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isUndefinedOrNull): Deleted. * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::handleIntrinsicCall): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): * dfg/DFGClobbersExitState.cpp: (JSC::DFG::clobbersExitState): * dfg/DFGConstantFoldingPhase.cpp: (JSC::DFG::ConstantFoldingPhase::foldConstants): * dfg/DFGDoesGC.cpp: (JSC::DFG::doesGC): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dump): * dfg/DFGHeapLocation.cpp: (WTF::printInternal): * dfg/DFGHeapLocation.h: * dfg/DFGMayExit.cpp: * dfg/DFGNode.h: (JSC::DFG::Node::convertToPhantomNewObject): (JSC::DFG::Node::convertToPhantomNewArrayIterator): (JSC::DFG::Node::convertToPhantomCreateActivation): (JSC::DFG::Node::hasStructure): (JSC::DFG::Node::hasObjectMaterializationData): (JSC::DFG::Node::isPhantomAllocation): * dfg/DFGNodeType.h: * dfg/DFGObjectAllocationSinkingPhase.cpp: * dfg/DFGOperations.cpp: * dfg/DFGOperations.h: * dfg/DFGPredictionPropagationPhase.cpp: * dfg/DFGPromotedHeapLocation.cpp: (WTF::printInternal): * dfg/DFGPromotedHeapLocation.h: (JSC::DFG::PromotedLocationDescriptor::neededForMaterialization const): * dfg/DFGSafeToExecute.h: (JSC::DFG::safeToExecute): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileCheckNeutered): (JSC::DFG::SpeculativeJIT::compileToObjectOrCallObjectConstructor): (JSC::DFG::SpeculativeJIT::compileNewInternalFieldObject): (JSC::DFG::SpeculativeJIT::compileNewArrayIterator): * dfg/DFGSpeculativeJIT.h: * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGStoreBarrierInsertionPhase.cpp: * dfg/DFGTypeCheckHoistingPhase.cpp: (JSC::DFG::TypeCheckHoistingPhase::identifyRedundantStructureChecks): (JSC::DFG::TypeCheckHoistingPhase::identifyRedundantArrayChecks): * dfg/DFGValidate.cpp: * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileNode): (JSC::FTL::DFG::LowerDFGToB3::compileToObjectOrCallObjectConstructor): (JSC::FTL::DFG::LowerDFGToB3::compileCheckArray): (JSC::FTL::DFG::LowerDFGToB3::compileCheckNeutered): (JSC::FTL::DFG::LowerDFGToB3::compileNewInternalFieldObject): (JSC::FTL::DFG::LowerDFGToB3::compileNewArrayIterator): (JSC::FTL::DFG::LowerDFGToB3::compileCreateInternalFieldObject): (JSC::FTL::DFG::LowerDFGToB3::compileMaterializeNewInternalFieldObjectImpl): (JSC::FTL::DFG::LowerDFGToB3::compileMaterializeNewInternalFieldObject): * ftl/FTLOperations.cpp: (JSC::FTL::operationPopulateObjectInOSR): (JSC::FTL::operationMaterializeObjectInOSR): * inspector/JSInjectedScriptHost.cpp: (Inspector::JSInjectedScriptHost::subtype): (Inspector::JSInjectedScriptHost::getInternalProperties): (Inspector::cloneArrayIteratorObject): (Inspector::JSInjectedScriptHost::iteratorEntries): * runtime/ArrayPrototype.cpp: (JSC::ArrayPrototype::finishCreation): (JSC::createArrayIteratorObject): (JSC::arrayProtoFuncValues): (JSC::arrayProtoFuncEntries): (JSC::arrayProtoFuncKeys): * runtime/CommonIdentifiers.h: * runtime/Intrinsic.cpp: (JSC::intrinsicName): * runtime/Intrinsic.h: * runtime/IterationKind.h: (): Deleted. * runtime/JSArrayIterator.cpp: Added. (JSC::JSArrayIterator::create): (JSC::JSArrayIterator::createWithInitialValues): (JSC::JSArrayIterator::createStructure): (JSC::JSArrayIterator::JSArrayIterator): (JSC::JSArrayIterator::finishCreation): (JSC::JSArrayIterator::visitChildren): * runtime/JSArrayIterator.h: Added. * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): (JSC::JSGlobalObject::visitChildren): * runtime/JSGlobalObject.h: (JSC::JSGlobalObject::arrayIteratorPrototype const): (JSC::JSGlobalObject::arrayIteratorStructure const): * runtime/JSMapIterator.h: * runtime/JSSetIterator.h: * runtime/JSType.cpp: (WTF::printInternal): * runtime/JSType.h: * runtime/JSTypedArrayViewPrototype.cpp: (JSC::createTypedArrayIteratorObject): (JSC::typedArrayViewProtoFuncValues): (JSC::typedArrayProtoViewFuncEntries): (JSC::typedArrayViewProtoFuncKeys): (JSC::JSTypedArrayViewPrototype::finishCreation): * runtime/VM.cpp: * runtime/VM.h: Source/WebCore: JSDOMIterator should just use the JSC IterationKind enum. Also, update other files for the enum member name changes. * bindings/js/JSDOMIterator.h: (WebCore::IteratorTraits>::asJS): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::serialize): * bindings/scripts/CodeGeneratorJS.pm: (GenerateIterableDefinition): * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::jsTestInterfacePrototypeFunctionEntriesCaller): (WebCore::jsTestInterfacePrototypeFunctionKeysCaller): (WebCore::jsTestInterfacePrototypeFunctionValuesCaller): * bindings/scripts/test/JS/JSTestIterable.cpp: (WebCore::jsTestIterablePrototypeFunctionEntriesCaller): (WebCore::jsTestIterablePrototypeFunctionKeysCaller): (WebCore::jsTestIterablePrototypeFunctionValuesCaller): * bindings/scripts/test/JS/JSTestNode.cpp: (WebCore::jsTestNodePrototypeFunctionEntriesCaller): (WebCore::jsTestNodePrototypeFunctionKeysCaller): (WebCore::jsTestNodePrototypeFunctionValuesCaller): LayoutTests: Change the labels of iteration kinds to match what JS refers to them as. * inspector/model/remote-object/iterator-expected.txt: * inspector/model/remote-object/iterator-large-expected.txt: * inspector/model/remote-object/iterators-mutated-expected.txt: Canonical link: https://commits.webkit.org/219108@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-09 06:07:29 +00:00
entries
find
findLast
findIndex
findLastIndex
includes
copyWithin
at
constructor
Symbol(Symbol.iterator)
Symbol(Symbol.unscopables)
valueOf
hasOwnProperty
propertyIsEnumerable
isPrototypeOf
__defineGetter__
__defineSetter__
__lookupGetter__
__lookupSetter__
__proto__
-----------------------------------------------------
-----------------------------------------------------
EXPRESSION: window.arrayProto
type: object
subtype: array
description: Array
OWN PROPERTIES:
length
toString
values
toLocaleString
concat
fill
join
pop
push
reverse
shift
slice
sort
splice
unshift
every
forEach
some
indexOf
lastIndexOf
filter
flat
flatMap
reduce
reduceRight
map
keys
[JSC] Introduce JSArrayIterator https://bugs.webkit.org/show_bug.cgi?id=204043 Reviewed by Yusuke Suzuki. JSTests: * stress/array-iterator-materialize-at-osr-exit.js: Added. (shouldBe): (test): * stress/array-iterator-materialize-one-path.js: Added. (shouldBe): (test): * stress/array-iterator-materialize.js: Added. (shouldBe): (test): * stress/array-iterator-sinking.js: Added. (shouldBe): (test): * stress/array-iterators-next-error-messages.js: (catch): * stress/array-iterators-next-with-call.js: * stress/for-of-iteration.js: Added. (shouldBe): (test1): (test2): (test3): * stress/typedarray-functions-with-neutered.js: (checkProtoFunc): Source/JavaScriptCore: This patch introduces JSArrayIterator that changes the iterator object from a JSFinalObject to an InternalFieldsObject. This makes accessing it much easier from C++ code and makes the iterator object smaller. It also means that the JS code for the next function is much simpler and can *almost* be inlined without shenanigans. As part of this patch the keys/values/entries functions have been converted to C++ with intrinsics since that's slightly more efficient in the LLInt/Baseline. Lastly, this patch also add a custom ISOSubspace for JSArrayIterator objects. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * builtins/ArrayIteratorPrototype.js: (next): (globalPrivate.arrayIteratorNextHelper): (globalPrivate.arrayIteratorValueNext): Deleted. (globalPrivate.arrayIteratorKeyNext): Deleted. (globalPrivate.arrayIteratorKeyValueNext): Deleted. * builtins/ArrayPrototype.js: (globalPrivate.ArrayIterator): Deleted. (values): Deleted. (keys): Deleted. (entries): Deleted. * builtins/TypedArrayPrototype.js: (values): Deleted. (keys): Deleted. (entries): Deleted. * bytecode/BytecodeIntrinsicRegistry.cpp: (JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry): * bytecode/BytecodeIntrinsicRegistry.h: * bytecompiler/BytecodeGenerator.h: (JSC::BytecodeGenerator::emitIsArrayIterator): * bytecompiler/NodesCodegen.cpp: (JSC::arrayIteratorInternalFieldIndex): (JSC::BytecodeIntrinsicNode::emit_intrinsic_getArrayIteratorInternalField): (JSC::BytecodeIntrinsicNode::emit_intrinsic_putArrayIteratorInternalField): (JSC::BytecodeIntrinsicNode::emit_intrinsic_isGenerator): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isAsyncGenerator): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isJSArray): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isPromise): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isProxyObject): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isRegExpObject): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isObject): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isDerivedArray): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isMap): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isSet): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isUndefinedOrNull): Deleted. * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::handleIntrinsicCall): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): * dfg/DFGClobbersExitState.cpp: (JSC::DFG::clobbersExitState): * dfg/DFGConstantFoldingPhase.cpp: (JSC::DFG::ConstantFoldingPhase::foldConstants): * dfg/DFGDoesGC.cpp: (JSC::DFG::doesGC): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dump): * dfg/DFGHeapLocation.cpp: (WTF::printInternal): * dfg/DFGHeapLocation.h: * dfg/DFGMayExit.cpp: * dfg/DFGNode.h: (JSC::DFG::Node::convertToPhantomNewObject): (JSC::DFG::Node::convertToPhantomNewArrayIterator): (JSC::DFG::Node::convertToPhantomCreateActivation): (JSC::DFG::Node::hasStructure): (JSC::DFG::Node::hasObjectMaterializationData): (JSC::DFG::Node::isPhantomAllocation): * dfg/DFGNodeType.h: * dfg/DFGObjectAllocationSinkingPhase.cpp: * dfg/DFGOperations.cpp: * dfg/DFGOperations.h: * dfg/DFGPredictionPropagationPhase.cpp: * dfg/DFGPromotedHeapLocation.cpp: (WTF::printInternal): * dfg/DFGPromotedHeapLocation.h: (JSC::DFG::PromotedLocationDescriptor::neededForMaterialization const): * dfg/DFGSafeToExecute.h: (JSC::DFG::safeToExecute): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileCheckNeutered): (JSC::DFG::SpeculativeJIT::compileToObjectOrCallObjectConstructor): (JSC::DFG::SpeculativeJIT::compileNewInternalFieldObject): (JSC::DFG::SpeculativeJIT::compileNewArrayIterator): * dfg/DFGSpeculativeJIT.h: * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGStoreBarrierInsertionPhase.cpp: * dfg/DFGTypeCheckHoistingPhase.cpp: (JSC::DFG::TypeCheckHoistingPhase::identifyRedundantStructureChecks): (JSC::DFG::TypeCheckHoistingPhase::identifyRedundantArrayChecks): * dfg/DFGValidate.cpp: * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileNode): (JSC::FTL::DFG::LowerDFGToB3::compileToObjectOrCallObjectConstructor): (JSC::FTL::DFG::LowerDFGToB3::compileCheckArray): (JSC::FTL::DFG::LowerDFGToB3::compileCheckNeutered): (JSC::FTL::DFG::LowerDFGToB3::compileNewInternalFieldObject): (JSC::FTL::DFG::LowerDFGToB3::compileNewArrayIterator): (JSC::FTL::DFG::LowerDFGToB3::compileCreateInternalFieldObject): (JSC::FTL::DFG::LowerDFGToB3::compileMaterializeNewInternalFieldObjectImpl): (JSC::FTL::DFG::LowerDFGToB3::compileMaterializeNewInternalFieldObject): * ftl/FTLOperations.cpp: (JSC::FTL::operationPopulateObjectInOSR): (JSC::FTL::operationMaterializeObjectInOSR): * inspector/JSInjectedScriptHost.cpp: (Inspector::JSInjectedScriptHost::subtype): (Inspector::JSInjectedScriptHost::getInternalProperties): (Inspector::cloneArrayIteratorObject): (Inspector::JSInjectedScriptHost::iteratorEntries): * runtime/ArrayPrototype.cpp: (JSC::ArrayPrototype::finishCreation): (JSC::createArrayIteratorObject): (JSC::arrayProtoFuncValues): (JSC::arrayProtoFuncEntries): (JSC::arrayProtoFuncKeys): * runtime/CommonIdentifiers.h: * runtime/Intrinsic.cpp: (JSC::intrinsicName): * runtime/Intrinsic.h: * runtime/IterationKind.h: (): Deleted. * runtime/JSArrayIterator.cpp: Added. (JSC::JSArrayIterator::create): (JSC::JSArrayIterator::createWithInitialValues): (JSC::JSArrayIterator::createStructure): (JSC::JSArrayIterator::JSArrayIterator): (JSC::JSArrayIterator::finishCreation): (JSC::JSArrayIterator::visitChildren): * runtime/JSArrayIterator.h: Added. * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): (JSC::JSGlobalObject::visitChildren): * runtime/JSGlobalObject.h: (JSC::JSGlobalObject::arrayIteratorPrototype const): (JSC::JSGlobalObject::arrayIteratorStructure const): * runtime/JSMapIterator.h: * runtime/JSSetIterator.h: * runtime/JSType.cpp: (WTF::printInternal): * runtime/JSType.h: * runtime/JSTypedArrayViewPrototype.cpp: (JSC::createTypedArrayIteratorObject): (JSC::typedArrayViewProtoFuncValues): (JSC::typedArrayProtoViewFuncEntries): (JSC::typedArrayViewProtoFuncKeys): (JSC::JSTypedArrayViewPrototype::finishCreation): * runtime/VM.cpp: * runtime/VM.h: Source/WebCore: JSDOMIterator should just use the JSC IterationKind enum. Also, update other files for the enum member name changes. * bindings/js/JSDOMIterator.h: (WebCore::IteratorTraits>::asJS): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::serialize): * bindings/scripts/CodeGeneratorJS.pm: (GenerateIterableDefinition): * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::jsTestInterfacePrototypeFunctionEntriesCaller): (WebCore::jsTestInterfacePrototypeFunctionKeysCaller): (WebCore::jsTestInterfacePrototypeFunctionValuesCaller): * bindings/scripts/test/JS/JSTestIterable.cpp: (WebCore::jsTestIterablePrototypeFunctionEntriesCaller): (WebCore::jsTestIterablePrototypeFunctionKeysCaller): (WebCore::jsTestIterablePrototypeFunctionValuesCaller): * bindings/scripts/test/JS/JSTestNode.cpp: (WebCore::jsTestNodePrototypeFunctionEntriesCaller): (WebCore::jsTestNodePrototypeFunctionKeysCaller): (WebCore::jsTestNodePrototypeFunctionValuesCaller): LayoutTests: Change the labels of iteration kinds to match what JS refers to them as. * inspector/model/remote-object/iterator-expected.txt: * inspector/model/remote-object/iterator-large-expected.txt: * inspector/model/remote-object/iterators-mutated-expected.txt: Canonical link: https://commits.webkit.org/219108@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-09 06:07:29 +00:00
entries
find
findLast
findIndex
findLastIndex
includes
copyWithin
at
constructor
Symbol(Symbol.iterator)
Symbol(Symbol.unscopables)
__proto__
DISPLAYABLE PROPERTIES:
length
toString
values
toLocaleString
concat
fill
join
pop
push
reverse
shift
slice
sort
splice
unshift
every
forEach
some
indexOf
lastIndexOf
filter
flat
flatMap
reduce
reduceRight
map
keys
[JSC] Introduce JSArrayIterator https://bugs.webkit.org/show_bug.cgi?id=204043 Reviewed by Yusuke Suzuki. JSTests: * stress/array-iterator-materialize-at-osr-exit.js: Added. (shouldBe): (test): * stress/array-iterator-materialize-one-path.js: Added. (shouldBe): (test): * stress/array-iterator-materialize.js: Added. (shouldBe): (test): * stress/array-iterator-sinking.js: Added. (shouldBe): (test): * stress/array-iterators-next-error-messages.js: (catch): * stress/array-iterators-next-with-call.js: * stress/for-of-iteration.js: Added. (shouldBe): (test1): (test2): (test3): * stress/typedarray-functions-with-neutered.js: (checkProtoFunc): Source/JavaScriptCore: This patch introduces JSArrayIterator that changes the iterator object from a JSFinalObject to an InternalFieldsObject. This makes accessing it much easier from C++ code and makes the iterator object smaller. It also means that the JS code for the next function is much simpler and can *almost* be inlined without shenanigans. As part of this patch the keys/values/entries functions have been converted to C++ with intrinsics since that's slightly more efficient in the LLInt/Baseline. Lastly, this patch also add a custom ISOSubspace for JSArrayIterator objects. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * builtins/ArrayIteratorPrototype.js: (next): (globalPrivate.arrayIteratorNextHelper): (globalPrivate.arrayIteratorValueNext): Deleted. (globalPrivate.arrayIteratorKeyNext): Deleted. (globalPrivate.arrayIteratorKeyValueNext): Deleted. * builtins/ArrayPrototype.js: (globalPrivate.ArrayIterator): Deleted. (values): Deleted. (keys): Deleted. (entries): Deleted. * builtins/TypedArrayPrototype.js: (values): Deleted. (keys): Deleted. (entries): Deleted. * bytecode/BytecodeIntrinsicRegistry.cpp: (JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry): * bytecode/BytecodeIntrinsicRegistry.h: * bytecompiler/BytecodeGenerator.h: (JSC::BytecodeGenerator::emitIsArrayIterator): * bytecompiler/NodesCodegen.cpp: (JSC::arrayIteratorInternalFieldIndex): (JSC::BytecodeIntrinsicNode::emit_intrinsic_getArrayIteratorInternalField): (JSC::BytecodeIntrinsicNode::emit_intrinsic_putArrayIteratorInternalField): (JSC::BytecodeIntrinsicNode::emit_intrinsic_isGenerator): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isAsyncGenerator): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isJSArray): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isPromise): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isProxyObject): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isRegExpObject): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isObject): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isDerivedArray): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isMap): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isSet): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isUndefinedOrNull): Deleted. * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::handleIntrinsicCall): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): * dfg/DFGClobbersExitState.cpp: (JSC::DFG::clobbersExitState): * dfg/DFGConstantFoldingPhase.cpp: (JSC::DFG::ConstantFoldingPhase::foldConstants): * dfg/DFGDoesGC.cpp: (JSC::DFG::doesGC): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dump): * dfg/DFGHeapLocation.cpp: (WTF::printInternal): * dfg/DFGHeapLocation.h: * dfg/DFGMayExit.cpp: * dfg/DFGNode.h: (JSC::DFG::Node::convertToPhantomNewObject): (JSC::DFG::Node::convertToPhantomNewArrayIterator): (JSC::DFG::Node::convertToPhantomCreateActivation): (JSC::DFG::Node::hasStructure): (JSC::DFG::Node::hasObjectMaterializationData): (JSC::DFG::Node::isPhantomAllocation): * dfg/DFGNodeType.h: * dfg/DFGObjectAllocationSinkingPhase.cpp: * dfg/DFGOperations.cpp: * dfg/DFGOperations.h: * dfg/DFGPredictionPropagationPhase.cpp: * dfg/DFGPromotedHeapLocation.cpp: (WTF::printInternal): * dfg/DFGPromotedHeapLocation.h: (JSC::DFG::PromotedLocationDescriptor::neededForMaterialization const): * dfg/DFGSafeToExecute.h: (JSC::DFG::safeToExecute): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileCheckNeutered): (JSC::DFG::SpeculativeJIT::compileToObjectOrCallObjectConstructor): (JSC::DFG::SpeculativeJIT::compileNewInternalFieldObject): (JSC::DFG::SpeculativeJIT::compileNewArrayIterator): * dfg/DFGSpeculativeJIT.h: * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGStoreBarrierInsertionPhase.cpp: * dfg/DFGTypeCheckHoistingPhase.cpp: (JSC::DFG::TypeCheckHoistingPhase::identifyRedundantStructureChecks): (JSC::DFG::TypeCheckHoistingPhase::identifyRedundantArrayChecks): * dfg/DFGValidate.cpp: * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileNode): (JSC::FTL::DFG::LowerDFGToB3::compileToObjectOrCallObjectConstructor): (JSC::FTL::DFG::LowerDFGToB3::compileCheckArray): (JSC::FTL::DFG::LowerDFGToB3::compileCheckNeutered): (JSC::FTL::DFG::LowerDFGToB3::compileNewInternalFieldObject): (JSC::FTL::DFG::LowerDFGToB3::compileNewArrayIterator): (JSC::FTL::DFG::LowerDFGToB3::compileCreateInternalFieldObject): (JSC::FTL::DFG::LowerDFGToB3::compileMaterializeNewInternalFieldObjectImpl): (JSC::FTL::DFG::LowerDFGToB3::compileMaterializeNewInternalFieldObject): * ftl/FTLOperations.cpp: (JSC::FTL::operationPopulateObjectInOSR): (JSC::FTL::operationMaterializeObjectInOSR): * inspector/JSInjectedScriptHost.cpp: (Inspector::JSInjectedScriptHost::subtype): (Inspector::JSInjectedScriptHost::getInternalProperties): (Inspector::cloneArrayIteratorObject): (Inspector::JSInjectedScriptHost::iteratorEntries): * runtime/ArrayPrototype.cpp: (JSC::ArrayPrototype::finishCreation): (JSC::createArrayIteratorObject): (JSC::arrayProtoFuncValues): (JSC::arrayProtoFuncEntries): (JSC::arrayProtoFuncKeys): * runtime/CommonIdentifiers.h: * runtime/Intrinsic.cpp: (JSC::intrinsicName): * runtime/Intrinsic.h: * runtime/IterationKind.h: (): Deleted. * runtime/JSArrayIterator.cpp: Added. (JSC::JSArrayIterator::create): (JSC::JSArrayIterator::createWithInitialValues): (JSC::JSArrayIterator::createStructure): (JSC::JSArrayIterator::JSArrayIterator): (JSC::JSArrayIterator::finishCreation): (JSC::JSArrayIterator::visitChildren): * runtime/JSArrayIterator.h: Added. * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): (JSC::JSGlobalObject::visitChildren): * runtime/JSGlobalObject.h: (JSC::JSGlobalObject::arrayIteratorPrototype const): (JSC::JSGlobalObject::arrayIteratorStructure const): * runtime/JSMapIterator.h: * runtime/JSSetIterator.h: * runtime/JSType.cpp: (WTF::printInternal): * runtime/JSType.h: * runtime/JSTypedArrayViewPrototype.cpp: (JSC::createTypedArrayIteratorObject): (JSC::typedArrayViewProtoFuncValues): (JSC::typedArrayProtoViewFuncEntries): (JSC::typedArrayViewProtoFuncKeys): (JSC::JSTypedArrayViewPrototype::finishCreation): * runtime/VM.cpp: * runtime/VM.h: Source/WebCore: JSDOMIterator should just use the JSC IterationKind enum. Also, update other files for the enum member name changes. * bindings/js/JSDOMIterator.h: (WebCore::IteratorTraits>::asJS): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::serialize): * bindings/scripts/CodeGeneratorJS.pm: (GenerateIterableDefinition): * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::jsTestInterfacePrototypeFunctionEntriesCaller): (WebCore::jsTestInterfacePrototypeFunctionKeysCaller): (WebCore::jsTestInterfacePrototypeFunctionValuesCaller): * bindings/scripts/test/JS/JSTestIterable.cpp: (WebCore::jsTestIterablePrototypeFunctionEntriesCaller): (WebCore::jsTestIterablePrototypeFunctionKeysCaller): (WebCore::jsTestIterablePrototypeFunctionValuesCaller): * bindings/scripts/test/JS/JSTestNode.cpp: (WebCore::jsTestNodePrototypeFunctionEntriesCaller): (WebCore::jsTestNodePrototypeFunctionKeysCaller): (WebCore::jsTestNodePrototypeFunctionValuesCaller): LayoutTests: Change the labels of iteration kinds to match what JS refers to them as. * inspector/model/remote-object/iterator-expected.txt: * inspector/model/remote-object/iterator-large-expected.txt: * inspector/model/remote-object/iterators-mutated-expected.txt: Canonical link: https://commits.webkit.org/219108@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-09 06:07:29 +00:00
entries
find
findLast
findIndex
findLastIndex
includes
copyWithin
at
constructor
Symbol(Symbol.iterator)
Symbol(Symbol.unscopables)
__proto__
ALL PROPERTIES:
length
toString
values
toLocaleString
concat
fill
join
pop
push
reverse
shift
slice
sort
splice
unshift
every
forEach
some
indexOf
lastIndexOf
filter
flat
flatMap
reduce
reduceRight
map
keys
[JSC] Introduce JSArrayIterator https://bugs.webkit.org/show_bug.cgi?id=204043 Reviewed by Yusuke Suzuki. JSTests: * stress/array-iterator-materialize-at-osr-exit.js: Added. (shouldBe): (test): * stress/array-iterator-materialize-one-path.js: Added. (shouldBe): (test): * stress/array-iterator-materialize.js: Added. (shouldBe): (test): * stress/array-iterator-sinking.js: Added. (shouldBe): (test): * stress/array-iterators-next-error-messages.js: (catch): * stress/array-iterators-next-with-call.js: * stress/for-of-iteration.js: Added. (shouldBe): (test1): (test2): (test3): * stress/typedarray-functions-with-neutered.js: (checkProtoFunc): Source/JavaScriptCore: This patch introduces JSArrayIterator that changes the iterator object from a JSFinalObject to an InternalFieldsObject. This makes accessing it much easier from C++ code and makes the iterator object smaller. It also means that the JS code for the next function is much simpler and can *almost* be inlined without shenanigans. As part of this patch the keys/values/entries functions have been converted to C++ with intrinsics since that's slightly more efficient in the LLInt/Baseline. Lastly, this patch also add a custom ISOSubspace for JSArrayIterator objects. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * builtins/ArrayIteratorPrototype.js: (next): (globalPrivate.arrayIteratorNextHelper): (globalPrivate.arrayIteratorValueNext): Deleted. (globalPrivate.arrayIteratorKeyNext): Deleted. (globalPrivate.arrayIteratorKeyValueNext): Deleted. * builtins/ArrayPrototype.js: (globalPrivate.ArrayIterator): Deleted. (values): Deleted. (keys): Deleted. (entries): Deleted. * builtins/TypedArrayPrototype.js: (values): Deleted. (keys): Deleted. (entries): Deleted. * bytecode/BytecodeIntrinsicRegistry.cpp: (JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry): * bytecode/BytecodeIntrinsicRegistry.h: * bytecompiler/BytecodeGenerator.h: (JSC::BytecodeGenerator::emitIsArrayIterator): * bytecompiler/NodesCodegen.cpp: (JSC::arrayIteratorInternalFieldIndex): (JSC::BytecodeIntrinsicNode::emit_intrinsic_getArrayIteratorInternalField): (JSC::BytecodeIntrinsicNode::emit_intrinsic_putArrayIteratorInternalField): (JSC::BytecodeIntrinsicNode::emit_intrinsic_isGenerator): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isAsyncGenerator): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isJSArray): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isPromise): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isProxyObject): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isRegExpObject): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isObject): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isDerivedArray): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isMap): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isSet): Deleted. (JSC::BytecodeIntrinsicNode::emit_intrinsic_isUndefinedOrNull): Deleted. * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::handleIntrinsicCall): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): * dfg/DFGClobbersExitState.cpp: (JSC::DFG::clobbersExitState): * dfg/DFGConstantFoldingPhase.cpp: (JSC::DFG::ConstantFoldingPhase::foldConstants): * dfg/DFGDoesGC.cpp: (JSC::DFG::doesGC): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dump): * dfg/DFGHeapLocation.cpp: (WTF::printInternal): * dfg/DFGHeapLocation.h: * dfg/DFGMayExit.cpp: * dfg/DFGNode.h: (JSC::DFG::Node::convertToPhantomNewObject): (JSC::DFG::Node::convertToPhantomNewArrayIterator): (JSC::DFG::Node::convertToPhantomCreateActivation): (JSC::DFG::Node::hasStructure): (JSC::DFG::Node::hasObjectMaterializationData): (JSC::DFG::Node::isPhantomAllocation): * dfg/DFGNodeType.h: * dfg/DFGObjectAllocationSinkingPhase.cpp: * dfg/DFGOperations.cpp: * dfg/DFGOperations.h: * dfg/DFGPredictionPropagationPhase.cpp: * dfg/DFGPromotedHeapLocation.cpp: (WTF::printInternal): * dfg/DFGPromotedHeapLocation.h: (JSC::DFG::PromotedLocationDescriptor::neededForMaterialization const): * dfg/DFGSafeToExecute.h: (JSC::DFG::safeToExecute): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileCheckNeutered): (JSC::DFG::SpeculativeJIT::compileToObjectOrCallObjectConstructor): (JSC::DFG::SpeculativeJIT::compileNewInternalFieldObject): (JSC::DFG::SpeculativeJIT::compileNewArrayIterator): * dfg/DFGSpeculativeJIT.h: * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGStoreBarrierInsertionPhase.cpp: * dfg/DFGTypeCheckHoistingPhase.cpp: (JSC::DFG::TypeCheckHoistingPhase::identifyRedundantStructureChecks): (JSC::DFG::TypeCheckHoistingPhase::identifyRedundantArrayChecks): * dfg/DFGValidate.cpp: * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileNode): (JSC::FTL::DFG::LowerDFGToB3::compileToObjectOrCallObjectConstructor): (JSC::FTL::DFG::LowerDFGToB3::compileCheckArray): (JSC::FTL::DFG::LowerDFGToB3::compileCheckNeutered): (JSC::FTL::DFG::LowerDFGToB3::compileNewInternalFieldObject): (JSC::FTL::DFG::LowerDFGToB3::compileNewArrayIterator): (JSC::FTL::DFG::LowerDFGToB3::compileCreateInternalFieldObject): (JSC::FTL::DFG::LowerDFGToB3::compileMaterializeNewInternalFieldObjectImpl): (JSC::FTL::DFG::LowerDFGToB3::compileMaterializeNewInternalFieldObject): * ftl/FTLOperations.cpp: (JSC::FTL::operationPopulateObjectInOSR): (JSC::FTL::operationMaterializeObjectInOSR): * inspector/JSInjectedScriptHost.cpp: (Inspector::JSInjectedScriptHost::subtype): (Inspector::JSInjectedScriptHost::getInternalProperties): (Inspector::cloneArrayIteratorObject): (Inspector::JSInjectedScriptHost::iteratorEntries): * runtime/ArrayPrototype.cpp: (JSC::ArrayPrototype::finishCreation): (JSC::createArrayIteratorObject): (JSC::arrayProtoFuncValues): (JSC::arrayProtoFuncEntries): (JSC::arrayProtoFuncKeys): * runtime/CommonIdentifiers.h: * runtime/Intrinsic.cpp: (JSC::intrinsicName): * runtime/Intrinsic.h: * runtime/IterationKind.h: (): Deleted. * runtime/JSArrayIterator.cpp: Added. (JSC::JSArrayIterator::create): (JSC::JSArrayIterator::createWithInitialValues): (JSC::JSArrayIterator::createStructure): (JSC::JSArrayIterator::JSArrayIterator): (JSC::JSArrayIterator::finishCreation): (JSC::JSArrayIterator::visitChildren): * runtime/JSArrayIterator.h: Added. * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): (JSC::JSGlobalObject::visitChildren): * runtime/JSGlobalObject.h: (JSC::JSGlobalObject::arrayIteratorPrototype const): (JSC::JSGlobalObject::arrayIteratorStructure const): * runtime/JSMapIterator.h: * runtime/JSSetIterator.h: * runtime/JSType.cpp: (WTF::printInternal): * runtime/JSType.h: * runtime/JSTypedArrayViewPrototype.cpp: (JSC::createTypedArrayIteratorObject): (JSC::typedArrayViewProtoFuncValues): (JSC::typedArrayProtoViewFuncEntries): (JSC::typedArrayViewProtoFuncKeys): (JSC::JSTypedArrayViewPrototype::finishCreation): * runtime/VM.cpp: * runtime/VM.h: Source/WebCore: JSDOMIterator should just use the JSC IterationKind enum. Also, update other files for the enum member name changes. * bindings/js/JSDOMIterator.h: (WebCore::IteratorTraits>::asJS): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::serialize): * bindings/scripts/CodeGeneratorJS.pm: (GenerateIterableDefinition): * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::jsTestInterfacePrototypeFunctionEntriesCaller): (WebCore::jsTestInterfacePrototypeFunctionKeysCaller): (WebCore::jsTestInterfacePrototypeFunctionValuesCaller): * bindings/scripts/test/JS/JSTestIterable.cpp: (WebCore::jsTestIterablePrototypeFunctionEntriesCaller): (WebCore::jsTestIterablePrototypeFunctionKeysCaller): (WebCore::jsTestIterablePrototypeFunctionValuesCaller): * bindings/scripts/test/JS/JSTestNode.cpp: (WebCore::jsTestNodePrototypeFunctionEntriesCaller): (WebCore::jsTestNodePrototypeFunctionKeysCaller): (WebCore::jsTestNodePrototypeFunctionValuesCaller): LayoutTests: Change the labels of iteration kinds to match what JS refers to them as. * inspector/model/remote-object/iterator-expected.txt: * inspector/model/remote-object/iterator-large-expected.txt: * inspector/model/remote-object/iterators-mutated-expected.txt: Canonical link: https://commits.webkit.org/219108@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-09 06:07:29 +00:00
entries
find
findLast
findIndex
findLastIndex
includes
copyWithin
at
constructor
Symbol(Symbol.iterator)
Symbol(Symbol.unscopables)
valueOf
hasOwnProperty
propertyIsEnumerable
isPrototypeOf
__defineGetter__
__defineSetter__
__lookupGetter__
__lookupSetter__
__proto__
-----------------------------------------------------
Web Inspector: Expanding event objects in console shows undefined for most values, it should have real values https://bugs.webkit.org/show_bug.cgi?id=137306 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-01-20 Reviewed by Timothy Hatcher. Source/JavaScriptCore: Provide another optional parameter to getProperties, to gather a list of all own and getter properties. * inspector/InjectedScript.cpp: (Inspector::InjectedScript::getProperties): * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getProperties): * inspector/agents/InspectorRuntimeAgent.h: * inspector/protocol/Runtime.json: Source/WebInspectorUI: When first expanding an object, show all the object's own properties and any getter properties that may be on its prototype chain. Now, we only fetch own properties, for __proto__ properties. * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.prototype.getOwnProperties): (WebInspector.RemoteObject.prototype.getOwnAndGetterProperties): (WebInspector.RemoteObject.prototype.getAllProperties): (WebInspector.RemoteObject.prototype.get hasChildren): Deleted. * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.ObjectPropertiesSection): (WebInspector.ObjectPropertiesSection.prototype.update): (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate): LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: Added. * inspector/model/remote-object-get-properties.html: Added. Canonical link: https://commits.webkit.org/158679@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178768 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-01-21 00:34:57 +00:00
-----------------------------------------------------
EXPRESSION: window.loadEvent
type: object
description: Event
OWN PROPERTIES:
isTrusted
Web Inspector: Expanding event objects in console shows undefined for most values, it should have real values https://bugs.webkit.org/show_bug.cgi?id=137306 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-01-20 Reviewed by Timothy Hatcher. Source/JavaScriptCore: Provide another optional parameter to getProperties, to gather a list of all own and getter properties. * inspector/InjectedScript.cpp: (Inspector::InjectedScript::getProperties): * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getProperties): * inspector/agents/InspectorRuntimeAgent.h: * inspector/protocol/Runtime.json: Source/WebInspectorUI: When first expanding an object, show all the object's own properties and any getter properties that may be on its prototype chain. Now, we only fetch own properties, for __proto__ properties. * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.prototype.getOwnProperties): (WebInspector.RemoteObject.prototype.getOwnAndGetterProperties): (WebInspector.RemoteObject.prototype.getAllProperties): (WebInspector.RemoteObject.prototype.get hasChildren): Deleted. * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.ObjectPropertiesSection): (WebInspector.ObjectPropertiesSection.prototype.update): (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate): LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: Added. * inspector/model/remote-object-get-properties.html: Added. Canonical link: https://commits.webkit.org/158679@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178768 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-01-21 00:34:57 +00:00
__proto__
Web Inspector: Make Getter/Setter RemoteObject property and ObjectPreview handling consistent https://bugs.webkit.org/show_bug.cgi?id=141587 Reviewed by Timothy Hatcher. Source/JavaScriptCore: Convert getProperties(ownAndGetterProperties) to getDisplayableProperties(). Mark PropertyDescriptors that are presumed to be native getters / bindings separately so that the frontend may display them differently. * inspector/InjectedScript.cpp: (Inspector::InjectedScript::getProperties): (Inspector::InjectedScript::getDisplayableProperties): * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getProperties): (Inspector::InspectorRuntimeAgent::getDisplayableProperties): * inspector/agents/InspectorRuntimeAgent.h: * inspector/protocol/Runtime.json: Source/WebInspectorUI: * UserInterface/Models/CallFrame.js: (WebInspector.CallFrame.prototype.collectScopeChainVariableNames): * UserInterface/Models/PropertyDescriptor.js: (WebInspector.PropertyDescriptor.prototype.get nativeGetter): * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.fromPayload): (WebInspector.RemoteObject.prototype.getOwnPropertyDescriptors): (WebInspector.RemoteObject.prototype.getAllPropertyDescriptors): (WebInspector.RemoteObject.prototype.getDisplayablePropertyDescriptors): (WebInspector.RemoteObject.prototype._getPropertyDescriptors): (WebInspector.RemoteObject.prototype.if): (WebInspector.RemoteObject.prototype.deprecatedGetOwnProperties): (WebInspector.RemoteObject.prototype.deprecatedGetAllProperties): (WebInspector.RemoteObject.prototype._deprecatedGetProperties): (WebInspector.RemoteObject.prototype.getOwnAndGetterPropertyDescriptors): Deleted. (WebInspector.RemoteObject.prototype.callback): Deleted. (WebInspector.RemoteObject.prototype.getOwnProperties): Deleted. (WebInspector.RemoteObject.prototype.getOwnAndGetterProperties): Deleted. (WebInspector.RemoteObject.prototype.getAllProperties): Deleted. (WebInspector.RemoteObject.prototype.set else): Deleted. * UserInterface/Views/ConsoleMessageImpl.js: (WebInspector.ConsoleMessageImpl.prototype._formatParameterAsArray): * UserInterface/Views/DOMNodeDetailsSidebarPanel.js: (WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshProperties.nodePrototypesReady): * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.ObjectPropertiesSection.prototype.update): (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate): * UserInterface/Views/ObjectTreePropertyTreeElement.js: (WebInspector.ObjectTreePropertyTreeElement.prototype.): (WebInspector.ObjectTreePropertyTreeElement.prototype): * UserInterface/Views/ObjectTreeView.js: (WebInspector.ObjectTreeView.prototype.update): LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: * inspector/model/remote-object-get-properties.html: Canonical link: https://commits.webkit.org/160009@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180594 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-02-25 00:31:42 +00:00
DISPLAYABLE PROPERTIES:
isTrusted
Web Inspector: Expanding event objects in console shows undefined for most values, it should have real values https://bugs.webkit.org/show_bug.cgi?id=137306 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-01-20 Reviewed by Timothy Hatcher. Source/JavaScriptCore: Provide another optional parameter to getProperties, to gather a list of all own and getter properties. * inspector/InjectedScript.cpp: (Inspector::InjectedScript::getProperties): * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getProperties): * inspector/agents/InspectorRuntimeAgent.h: * inspector/protocol/Runtime.json: Source/WebInspectorUI: When first expanding an object, show all the object's own properties and any getter properties that may be on its prototype chain. Now, we only fetch own properties, for __proto__ properties. * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.prototype.getOwnProperties): (WebInspector.RemoteObject.prototype.getOwnAndGetterProperties): (WebInspector.RemoteObject.prototype.getAllProperties): (WebInspector.RemoteObject.prototype.get hasChildren): Deleted. * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.ObjectPropertiesSection): (WebInspector.ObjectPropertiesSection.prototype.update): (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate): LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: Added. * inspector/model/remote-object-get-properties.html: Added. Canonical link: https://commits.webkit.org/158679@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178768 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-01-21 00:34:57 +00:00
type
target
currentTarget
eventPhase
cancelBubble
Web Inspector: Expanding event objects in console shows undefined for most values, it should have real values https://bugs.webkit.org/show_bug.cgi?id=137306 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-01-20 Reviewed by Timothy Hatcher. Source/JavaScriptCore: Provide another optional parameter to getProperties, to gather a list of all own and getter properties. * inspector/InjectedScript.cpp: (Inspector::InjectedScript::getProperties): * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getProperties): * inspector/agents/InspectorRuntimeAgent.h: * inspector/protocol/Runtime.json: Source/WebInspectorUI: When first expanding an object, show all the object's own properties and any getter properties that may be on its prototype chain. Now, we only fetch own properties, for __proto__ properties. * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.prototype.getOwnProperties): (WebInspector.RemoteObject.prototype.getOwnAndGetterProperties): (WebInspector.RemoteObject.prototype.getAllProperties): (WebInspector.RemoteObject.prototype.get hasChildren): Deleted. * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.ObjectPropertiesSection): (WebInspector.ObjectPropertiesSection.prototype.update): (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate): LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: Added. * inspector/model/remote-object-get-properties.html: Added. Canonical link: https://commits.webkit.org/158679@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178768 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-01-21 00:34:57 +00:00
bubbles
cancelable
defaultPrevented
Replace scoped flag in Event by composed flag https://bugs.webkit.org/show_bug.cgi?id=158415 Reviewed by Chris Dumez. Source/WebCore: Replace `scoped` flag with `composed` flag and negate its meaning per the latest spec: https://dom.spec.whatwg.org/#dom-event-composed https://github.com/w3c/webcomponents/issues/513 In the old spec, every event was assumed to be "composed" (crosses shadow boundaries) by default and there was `scoped` flag which prevented the event from crossing bondaries, and there was a handful of events for which `scoped` was set true when dispatched by UA. In the new spec, every event is assumed to be "scoped" and a handful of user-initiated events set `composed` flag to true, which is also exposed in EventInit dictionary. `relatedTargetScoped` flag has been removed. New behavior is identical to when this flag was set to true. No new tests since existing tests are updated to test the new flag and behavior. * dom/CompositionEvent.cpp: (WebCore::CompositionEvent::isCompositionEvent): Added. * dom/CompositionEvent.h: * dom/Event.cpp: (WebCore::Event::Event): Initialize m_composed. Also re-ordered m_type and m_isInitialized for better packing. (WebCore::Event::composed): Renamed from Event::composed. We return true whenever composed is set to true in EventInit, or the engine is dispatching an user-initiated event listed in: https://github.com/w3c/webcomponents/issues/513#issuecomment-224183937 as well as keypress, cut, paste, and, copy as discussed in: https://github.com/w3c/webcomponents/issues/513#issuecomment-230988170 (WebCore::Event::isCompositionEvent): Added. * dom/Event.h: (WebCore::Event::composed): Added. (WebCore::Event::scoped): Deleted. (WebCore::Event::relatedTargetScoped): Deleted. (WebCore::Event): Reordered m_type and m_isInitialized for better packing. Added m_composed and removed m_scoped and m_relatedTargetScoped. * dom/Event.idl: * dom/EventPath.cpp: (WebCore::shouldEventCrossShadowBoundary): Returns true if the event did not originate from a shadow tree (this event entered the current shadow tree via a slot so we need to proceed with the normal bubble path outside the shadow tree) or composed flag is set true. (WebCore::EventPath::EventPath): m_event no longer exists, which was only used to get the value of relatedTargetScoped which has been removed. (WebCore::EventPath::setRelatedTarget): Behave as if relatedTargetScoped is always set true since the flag has been removed. * dom/EventPath.h: * dom/FocusEvent.cpp: (WebCore::FocusEvent::relatedTargetScoped): Deleted. * dom/FocusEvent.h: * dom/MouseEvent.cpp: (WebCore::MouseEvent::relatedTargetScoped): Deleted. * dom/MouseEvent.h: LayoutTests: Updated the tests to reflect the rename of scoped to composed and the negation of its semantics. Now every Event is assumed to be scoped / non-composed by default, and we need to explicitly set composed to true in order for events to cross shadow boundaries. Also, every Event behaves as if related target is assumed to be scoped in the old terminology althoug the flag no longer exists. * fast/shadow-dom/Extensions-to-Event-Interface-expected.txt: * fast/shadow-dom/Extensions-to-Event-Interface.html: Removed a test case that was testing relatedTargetScoped to false since this flag no longer exists. * fast/shadow-dom/MouseEvent-prototype-offsetX-offsetY.html: * fast/shadow-dom/event-inside-shadow-tree.html: * fast/shadow-dom/event-inside-slotted-node.html: * fast/shadow-dom/event-with-related-target.html: * fast/shadow-dom/trusted-event-scoped-flags-expected.txt: * fast/shadow-dom/trusted-event-scoped-flags.html: * fast/xmlhttprequest/xmlhttprequest-get-expected.txt: * http/tests/workers/worker-importScriptsOnError-expected.txt: * inspector/model/remote-object-get-properties-expected.txt: Canonical link: https://commits.webkit.org/177677@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202953 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-07-08 01:57:44 +00:00
composed
Web Inspector: Expanding event objects in console shows undefined for most values, it should have real values https://bugs.webkit.org/show_bug.cgi?id=137306 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-01-20 Reviewed by Timothy Hatcher. Source/JavaScriptCore: Provide another optional parameter to getProperties, to gather a list of all own and getter properties. * inspector/InjectedScript.cpp: (Inspector::InjectedScript::getProperties): * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getProperties): * inspector/agents/InspectorRuntimeAgent.h: * inspector/protocol/Runtime.json: Source/WebInspectorUI: When first expanding an object, show all the object's own properties and any getter properties that may be on its prototype chain. Now, we only fetch own properties, for __proto__ properties. * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.prototype.getOwnProperties): (WebInspector.RemoteObject.prototype.getOwnAndGetterProperties): (WebInspector.RemoteObject.prototype.getAllProperties): (WebInspector.RemoteObject.prototype.get hasChildren): Deleted. * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.ObjectPropertiesSection): (WebInspector.ObjectPropertiesSection.prototype.update): (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate): LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: Added. * inspector/model/remote-object-get-properties.html: Added. Canonical link: https://commits.webkit.org/158679@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178768 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-01-21 00:34:57 +00:00
timeStamp
srcElement
returnValue
__proto__
ALL PROPERTIES:
isTrusted
Web Inspector: Expanding event objects in console shows undefined for most values, it should have real values https://bugs.webkit.org/show_bug.cgi?id=137306 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-01-20 Reviewed by Timothy Hatcher. Source/JavaScriptCore: Provide another optional parameter to getProperties, to gather a list of all own and getter properties. * inspector/InjectedScript.cpp: (Inspector::InjectedScript::getProperties): * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getProperties): * inspector/agents/InspectorRuntimeAgent.h: * inspector/protocol/Runtime.json: Source/WebInspectorUI: When first expanding an object, show all the object's own properties and any getter properties that may be on its prototype chain. Now, we only fetch own properties, for __proto__ properties. * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.prototype.getOwnProperties): (WebInspector.RemoteObject.prototype.getOwnAndGetterProperties): (WebInspector.RemoteObject.prototype.getAllProperties): (WebInspector.RemoteObject.prototype.get hasChildren): Deleted. * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.ObjectPropertiesSection): (WebInspector.ObjectPropertiesSection.prototype.update): (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate): LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: Added. * inspector/model/remote-object-get-properties.html: Added. Canonical link: https://commits.webkit.org/158679@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178768 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-01-21 00:34:57 +00:00
constructor
type
target
currentTarget
eventPhase
cancelBubble
Web Inspector: Expanding event objects in console shows undefined for most values, it should have real values https://bugs.webkit.org/show_bug.cgi?id=137306 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-01-20 Reviewed by Timothy Hatcher. Source/JavaScriptCore: Provide another optional parameter to getProperties, to gather a list of all own and getter properties. * inspector/InjectedScript.cpp: (Inspector::InjectedScript::getProperties): * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getProperties): * inspector/agents/InspectorRuntimeAgent.h: * inspector/protocol/Runtime.json: Source/WebInspectorUI: When first expanding an object, show all the object's own properties and any getter properties that may be on its prototype chain. Now, we only fetch own properties, for __proto__ properties. * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.prototype.getOwnProperties): (WebInspector.RemoteObject.prototype.getOwnAndGetterProperties): (WebInspector.RemoteObject.prototype.getAllProperties): (WebInspector.RemoteObject.prototype.get hasChildren): Deleted. * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.ObjectPropertiesSection): (WebInspector.ObjectPropertiesSection.prototype.update): (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate): LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: Added. * inspector/model/remote-object-get-properties.html: Added. Canonical link: https://commits.webkit.org/158679@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178768 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-01-21 00:34:57 +00:00
bubbles
cancelable
defaultPrevented
Replace scoped flag in Event by composed flag https://bugs.webkit.org/show_bug.cgi?id=158415 Reviewed by Chris Dumez. Source/WebCore: Replace `scoped` flag with `composed` flag and negate its meaning per the latest spec: https://dom.spec.whatwg.org/#dom-event-composed https://github.com/w3c/webcomponents/issues/513 In the old spec, every event was assumed to be "composed" (crosses shadow boundaries) by default and there was `scoped` flag which prevented the event from crossing bondaries, and there was a handful of events for which `scoped` was set true when dispatched by UA. In the new spec, every event is assumed to be "scoped" and a handful of user-initiated events set `composed` flag to true, which is also exposed in EventInit dictionary. `relatedTargetScoped` flag has been removed. New behavior is identical to when this flag was set to true. No new tests since existing tests are updated to test the new flag and behavior. * dom/CompositionEvent.cpp: (WebCore::CompositionEvent::isCompositionEvent): Added. * dom/CompositionEvent.h: * dom/Event.cpp: (WebCore::Event::Event): Initialize m_composed. Also re-ordered m_type and m_isInitialized for better packing. (WebCore::Event::composed): Renamed from Event::composed. We return true whenever composed is set to true in EventInit, or the engine is dispatching an user-initiated event listed in: https://github.com/w3c/webcomponents/issues/513#issuecomment-224183937 as well as keypress, cut, paste, and, copy as discussed in: https://github.com/w3c/webcomponents/issues/513#issuecomment-230988170 (WebCore::Event::isCompositionEvent): Added. * dom/Event.h: (WebCore::Event::composed): Added. (WebCore::Event::scoped): Deleted. (WebCore::Event::relatedTargetScoped): Deleted. (WebCore::Event): Reordered m_type and m_isInitialized for better packing. Added m_composed and removed m_scoped and m_relatedTargetScoped. * dom/Event.idl: * dom/EventPath.cpp: (WebCore::shouldEventCrossShadowBoundary): Returns true if the event did not originate from a shadow tree (this event entered the current shadow tree via a slot so we need to proceed with the normal bubble path outside the shadow tree) or composed flag is set true. (WebCore::EventPath::EventPath): m_event no longer exists, which was only used to get the value of relatedTargetScoped which has been removed. (WebCore::EventPath::setRelatedTarget): Behave as if relatedTargetScoped is always set true since the flag has been removed. * dom/EventPath.h: * dom/FocusEvent.cpp: (WebCore::FocusEvent::relatedTargetScoped): Deleted. * dom/FocusEvent.h: * dom/MouseEvent.cpp: (WebCore::MouseEvent::relatedTargetScoped): Deleted. * dom/MouseEvent.h: LayoutTests: Updated the tests to reflect the rename of scoped to composed and the negation of its semantics. Now every Event is assumed to be scoped / non-composed by default, and we need to explicitly set composed to true in order for events to cross shadow boundaries. Also, every Event behaves as if related target is assumed to be scoped in the old terminology althoug the flag no longer exists. * fast/shadow-dom/Extensions-to-Event-Interface-expected.txt: * fast/shadow-dom/Extensions-to-Event-Interface.html: Removed a test case that was testing relatedTargetScoped to false since this flag no longer exists. * fast/shadow-dom/MouseEvent-prototype-offsetX-offsetY.html: * fast/shadow-dom/event-inside-shadow-tree.html: * fast/shadow-dom/event-inside-slotted-node.html: * fast/shadow-dom/event-with-related-target.html: * fast/shadow-dom/trusted-event-scoped-flags-expected.txt: * fast/shadow-dom/trusted-event-scoped-flags.html: * fast/xmlhttprequest/xmlhttprequest-get-expected.txt: * http/tests/workers/worker-importScriptsOnError-expected.txt: * inspector/model/remote-object-get-properties-expected.txt: Canonical link: https://commits.webkit.org/177677@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202953 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-07-08 01:57:44 +00:00
composed
Web Inspector: Expanding event objects in console shows undefined for most values, it should have real values https://bugs.webkit.org/show_bug.cgi?id=137306 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-01-20 Reviewed by Timothy Hatcher. Source/JavaScriptCore: Provide another optional parameter to getProperties, to gather a list of all own and getter properties. * inspector/InjectedScript.cpp: (Inspector::InjectedScript::getProperties): * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getProperties): * inspector/agents/InspectorRuntimeAgent.h: * inspector/protocol/Runtime.json: Source/WebInspectorUI: When first expanding an object, show all the object's own properties and any getter properties that may be on its prototype chain. Now, we only fetch own properties, for __proto__ properties. * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.prototype.getOwnProperties): (WebInspector.RemoteObject.prototype.getOwnAndGetterProperties): (WebInspector.RemoteObject.prototype.getAllProperties): (WebInspector.RemoteObject.prototype.get hasChildren): Deleted. * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.ObjectPropertiesSection): (WebInspector.ObjectPropertiesSection.prototype.update): (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate): LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: Added. * inspector/model/remote-object-get-properties.html: Added. Canonical link: https://commits.webkit.org/158679@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178768 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-01-21 00:34:57 +00:00
timeStamp
srcElement
returnValue
composedPath
[Web IDL] Operations should be on the instance for global objects or if [Unforgeable] https://bugs.webkit.org/show_bug.cgi?id=154120 <rdar://problem/24613231> Reviewed by Gavin Barraclough. LayoutTests/imported/w3c: Rebaseline now that more checks are passing. * web-platform-tests/html/dom/interfaces-expected.txt: Source/JavaScriptCore: Have putEntry() take a thisValue parameter in addition to the base, instead of relying on PropertySlot::thisValue() because this did not always do the right thing. In particular, when JSDOMWindow::put() was called to set a function, it would end up setting the new value on the JSDOMWindowShell instead of the actual JSDOMWindow. JSDOMWindow::getOwnPropertySlot() would then not be able to find it. Therefore the following would fail: $ window.open = "test" $ console.log(window.open) // prints the native function instead of "test" * runtime/JSObject.cpp: (JSC::JSObject::putInlineSlow): * runtime/Lookup.h: (JSC::putEntry): (JSC::lookupPut): Source/WebCore: Operations should be on the instance for global objects or if [Unforgeable] as per the Web IDL specification: - http://heycam.github.io/webidl/#es-operations - http://heycam.github.io/webidl/#dfn-unforgeable-on-an-interface This patch implements this behavior in order to align with the specification and other browsers. No new tests, already covered by existing tests. * bindings/js/JSDOMWindowCustom.cpp: (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess): Update function names now that they have "Instance" in their name instead of "Prototype". (WebCore::JSDOMWindow::getOwnPropertySlot): - Update function names now that they have "Instance" in their name instead of "Prototype". - Move the functions hard-coding *before* the static table check now that these functions are in the static table to maintain the previous behavior. * bindings/js/JSLocationCustom.cpp: (WebCore::JSLocation::getOwnPropertySlotDelegate): Update function names now that they have "Instance" in their name instead of "Prototype". * bindings/scripts/CodeGeneratorJS.pm: - Move functions to the instance if their interface is a global object or if they are marked as [Unforgeable]. Operations are now treated more like attributes, as they can now be either on the instance or the prototype. In a lot of places, I now use the naming "properties" instead of "attributes" as "properties" refer both "attributes" and "operations" / "functions". * bindings/scripts/test/JS/JSTestInterface.cpp: * bindings/scripts/test/JS/JSTestObj.cpp: Rebaseline bindings tests. LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: Rebaseline test because the order of static properties has changed: functions are now before constants instead of after. Canonical link: https://commits.webkit.org/172409@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196648 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-02-16 20:23:02 +00:00
stopPropagation
stopImmediatePropagation
[Web IDL] Operations should be on the instance for global objects or if [Unforgeable] https://bugs.webkit.org/show_bug.cgi?id=154120 <rdar://problem/24613231> Reviewed by Gavin Barraclough. LayoutTests/imported/w3c: Rebaseline now that more checks are passing. * web-platform-tests/html/dom/interfaces-expected.txt: Source/JavaScriptCore: Have putEntry() take a thisValue parameter in addition to the base, instead of relying on PropertySlot::thisValue() because this did not always do the right thing. In particular, when JSDOMWindow::put() was called to set a function, it would end up setting the new value on the JSDOMWindowShell instead of the actual JSDOMWindow. JSDOMWindow::getOwnPropertySlot() would then not be able to find it. Therefore the following would fail: $ window.open = "test" $ console.log(window.open) // prints the native function instead of "test" * runtime/JSObject.cpp: (JSC::JSObject::putInlineSlow): * runtime/Lookup.h: (JSC::putEntry): (JSC::lookupPut): Source/WebCore: Operations should be on the instance for global objects or if [Unforgeable] as per the Web IDL specification: - http://heycam.github.io/webidl/#es-operations - http://heycam.github.io/webidl/#dfn-unforgeable-on-an-interface This patch implements this behavior in order to align with the specification and other browsers. No new tests, already covered by existing tests. * bindings/js/JSDOMWindowCustom.cpp: (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess): Update function names now that they have "Instance" in their name instead of "Prototype". (WebCore::JSDOMWindow::getOwnPropertySlot): - Update function names now that they have "Instance" in their name instead of "Prototype". - Move the functions hard-coding *before* the static table check now that these functions are in the static table to maintain the previous behavior. * bindings/js/JSLocationCustom.cpp: (WebCore::JSLocation::getOwnPropertySlotDelegate): Update function names now that they have "Instance" in their name instead of "Prototype". * bindings/scripts/CodeGeneratorJS.pm: - Move functions to the instance if their interface is a global object or if they are marked as [Unforgeable]. Operations are now treated more like attributes, as they can now be either on the instance or the prototype. In a lot of places, I now use the naming "properties" instead of "attributes" as "properties" refer both "attributes" and "operations" / "functions". * bindings/scripts/test/JS/JSTestInterface.cpp: * bindings/scripts/test/JS/JSTestObj.cpp: Rebaseline bindings tests. LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: Rebaseline test because the order of static properties has changed: functions are now before constants instead of after. Canonical link: https://commits.webkit.org/172409@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196648 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-02-16 20:23:02 +00:00
preventDefault
initEvent
Web Inspector: Expanding event objects in console shows undefined for most values, it should have real values https://bugs.webkit.org/show_bug.cgi?id=137306 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-01-20 Reviewed by Timothy Hatcher. Source/JavaScriptCore: Provide another optional parameter to getProperties, to gather a list of all own and getter properties. * inspector/InjectedScript.cpp: (Inspector::InjectedScript::getProperties): * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getProperties): * inspector/agents/InspectorRuntimeAgent.h: * inspector/protocol/Runtime.json: Source/WebInspectorUI: When first expanding an object, show all the object's own properties and any getter properties that may be on its prototype chain. Now, we only fetch own properties, for __proto__ properties. * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.prototype.getOwnProperties): (WebInspector.RemoteObject.prototype.getOwnAndGetterProperties): (WebInspector.RemoteObject.prototype.getAllProperties): (WebInspector.RemoteObject.prototype.get hasChildren): Deleted. * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.ObjectPropertiesSection): (WebInspector.ObjectPropertiesSection.prototype.update): (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate): LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: Added. * inspector/model/remote-object-get-properties.html: Added. Canonical link: https://commits.webkit.org/158679@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178768 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-01-21 00:34:57 +00:00
NONE
CAPTURING_PHASE
AT_TARGET
BUBBLING_PHASE
[WebIDL] Interface prototype objects should define @@toStringTag https://bugs.webkit.org/show_bug.cgi?id=211020 Reviewed by Darin Adler. LayoutTests/imported/w3c: Adjust tests for `X.prototype.toString()` returning "[object X]" instead of "[object XPrototype]", where X is WebIDL interface. * web-platform-tests/WebIDL/ecmascript-binding/class-string-interface.any-expected.txt: * web-platform-tests/WebIDL/ecmascript-binding/class-string-interface.any.worker-expected.txt: * web-platform-tests/WebIDL/ecmascript-binding/class-string-named-properties-object.window-expected.txt: * web-platform-tests/dom/nodes/Document-createEvent.https-expected.txt: * web-platform-tests/html/browsers/the-window-object/window-prototype-chain.html: WPT revision: 50417942bbfe. * web-platform-tests/wasm/jsapi/instance/toString.any-expected.txt: * web-platform-tests/wasm/jsapi/instance/toString.any.worker-expected.txt: * web-platform-tests/wasm/jsapi/memory/toString.any-expected.txt: * web-platform-tests/wasm/jsapi/memory/toString.any.worker-expected.txt: * web-platform-tests/wasm/jsapi/module/toString.any-expected.txt: * web-platform-tests/wasm/jsapi/module/toString.any.worker-expected.txt: * web-platform-tests/wasm/jsapi/table/toString.any-expected.txt: * web-platform-tests/wasm/jsapi/table/toString.any.worker-expected.txt: Source/JavaScriptCore: WebIDL spec was recently updated [1] to define @@toStringTag on interface prototype objects. This change aligns WebIDL with ECMA-262 built-ins and Blink's behavior. Gecko have also expressed implementation commitment. This patch implements the spec change, making `X.prototype.toString()` return "[object X]" instead of "[object XPrototype]", where X is WebIDL interface. This behavior is proven to be web compatible (shipping in Chrome since Q2 2016) and matches class strings of iterator prototype objects [2] introduced in r253855. We define @@toStringTag for all WebAssembly interfaces but Error subclasses since they are not defined using WebIDL [3]. This change also introduces JSC_TO_STRING_TAG_WITHOUT_TRANSITION() macro that sets up @@toStringTag using ClassInfo to avoid extra strings creation, ensuring `className` equality between prototype and instance classes (fixing a few discrepancies), as well as correct descriptors. It also ensures using faster jsNontrivialString() and relieves from putting more code into CodeGeneratorJS.pm. [1]: https://github.com/heycam/webidl/pull/357 [2]: https://heycam.github.io/webidl/#es-iterator-prototype-object [3]: https://webassembly.github.io/spec/js-api/#error-objects Tests: imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.js imported/w3c/web-platform-tests/wasm/jsapi/memory/toString.any.js imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.js imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.js * runtime/ArrayIteratorPrototype.cpp: (JSC::ArrayIteratorPrototype::finishCreation): * runtime/AsyncFunctionPrototype.cpp: (JSC::AsyncFunctionPrototype::finishCreation): * runtime/AsyncGeneratorFunctionPrototype.cpp: (JSC::AsyncGeneratorFunctionPrototype::finishCreation): * runtime/AsyncGeneratorPrototype.cpp: (JSC::AsyncGeneratorPrototype::finishCreation): * runtime/BigIntPrototype.cpp: (JSC::BigIntPrototype::finishCreation): * runtime/GeneratorFunctionPrototype.cpp: (JSC::GeneratorFunctionPrototype::finishCreation): * runtime/GeneratorPrototype.cpp: (JSC::GeneratorPrototype::finishCreation): * runtime/IntlCollatorPrototype.cpp: (JSC::IntlCollatorPrototype::finishCreation): * runtime/IntlDateTimeFormatPrototype.cpp: (JSC::IntlDateTimeFormatPrototype::finishCreation): * runtime/IntlNumberFormatPrototype.cpp: (JSC::IntlNumberFormatPrototype::finishCreation): * runtime/IntlPluralRulesPrototype.cpp: (JSC::IntlPluralRulesPrototype::finishCreation): * runtime/IntlRelativeTimeFormatPrototype.cpp: (JSC::IntlRelativeTimeFormatPrototype::finishCreation): * runtime/JSArrayBufferPrototype.cpp: (JSC::JSArrayBufferPrototype::finishCreation): * runtime/JSDataViewPrototype.cpp: (JSC::JSDataViewPrototype::finishCreation): * runtime/JSONObject.cpp: (JSC::JSONObject::finishCreation): * runtime/JSObject.h: * runtime/JSPromisePrototype.cpp: (JSC::JSPromisePrototype::finishCreation): * runtime/MapIteratorPrototype.cpp: (JSC::MapIteratorPrototype::finishCreation): * runtime/MapPrototype.cpp: (JSC::MapPrototype::finishCreation): * runtime/MathObject.cpp: (JSC::MathObject::finishCreation): * runtime/RegExpStringIteratorPrototype.cpp: (JSC::RegExpStringIteratorPrototype::finishCreation): * runtime/SetIteratorPrototype.cpp: (JSC::SetIteratorPrototype::finishCreation): * runtime/SetPrototype.cpp: (JSC::SetPrototype::finishCreation): * runtime/StringIteratorPrototype.cpp: (JSC::StringIteratorPrototype::finishCreation): * runtime/SymbolPrototype.cpp: (JSC::SymbolPrototype::finishCreation): * runtime/WeakMapPrototype.cpp: (JSC::WeakMapPrototype::finishCreation): * runtime/WeakObjectRefPrototype.cpp: (JSC::WeakObjectRefPrototype::finishCreation): * runtime/WeakSetPrototype.cpp: (JSC::WeakSetPrototype::finishCreation): * wasm/js/WebAssemblyInstancePrototype.cpp: (JSC::WebAssemblyInstancePrototype::finishCreation): * wasm/js/WebAssemblyMemoryPrototype.cpp: (JSC::WebAssemblyMemoryPrototype::finishCreation): * wasm/js/WebAssemblyModulePrototype.cpp: (JSC::WebAssemblyModulePrototype::finishCreation): * wasm/js/WebAssemblyTablePrototype.cpp: (JSC::WebAssemblyTablePrototype::finishCreation): Source/WebCore: WebIDL spec was recently updated [1] to define @@toStringTag on interface prototype objects. This change aligns WebIDL with ECMA-262 built-ins and Blink's behavior. Gecko have also expressed implementation commitment. This patch implements the spec change, making `X.prototype.toString()` return "[object X]" instead of "[object XPrototype]", where X is WebIDL interface. This behavior is proven to be web compatible (shipping in Chrome since Q2 2016) and matches class strings of iterator prototype objects [2] introduced in r253855. [1]: https://github.com/heycam/webidl/pull/357 [2]: https://heycam.github.io/webidl/#es-iterator-prototype-object Tests: fast/dom/prototype-chain.html fast/dom/wrapper-classes.html fast/workers/DedicatedWorkerGlobalScope-prototype-chain.html imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/class-string-interface.any.js imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/class-string-named-properties-object.window.js * bindings/js/JSDOMIterator.h: (WebCore::IteratorTraits>::finishCreation): * bindings/js/JSDOMWindowProperties.cpp: (WebCore::JSDOMWindowProperties::finishCreation): * bindings/js/JSDOMWindowProperties.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): (GeneratePrototypeDeclaration): (GenerateConstructorHelperMethods): * bindings/scripts/test/*: Updated. LayoutTests: Adjust tests for `X.prototype.toString()` returning "[object X]" instead of "[object XPrototype]", where X is WebIDL interface. * css3/blending/background-blend-mode-property-parsing-expected.txt: * css3/blending/background-blend-mode-property-parsing.html: * css3/blending/blend-mode-property-parsing-expected.txt: * css3/blending/blend-mode-property-parsing.html: * css3/filters/backdrop/backdropfilter-property-parsing-expected.txt: * css3/filters/backdrop/backdropfilter-property-parsing.html: * css3/filters/filter-property-parsing-expected.txt: * css3/filters/filter-property-parsing.html: * fast/css/image-set-parsing-expected.txt: * fast/css/image-set-parsing-generated-expected.txt: * fast/css/image-set-parsing-generated.html: * fast/css/image-set-parsing.html: * fast/dom/DOMException/prototype-object-expected.txt: * fast/dom/DOMException/prototype-object.html: * fast/dom/prototype-chain-expected.txt: * fast/dom/wrapper-classes-expected.txt: * fast/dom/wrapper-classes.html: * fast/events/event-view-toString-expected.txt: * fast/workers/DedicatedWorkerGlobalScope-prototype-chain-expected.txt: * fast/workers/DedicatedWorkerGlobalScope-prototype-chain.html: * http/tests/xmlhttprequest/XMLHttpRequestException-expected.txt: * inspector/model/remote-object-get-properties-expected.txt: * platform/gtk/imported/w3c/web-platform-tests/dom/nodes/Document-createEvent.https-expected.txt: * platform/ios-wk2/imported/w3c/web-platform-tests/dom/nodes/Document-createEvent.https-expected.txt: * platform/wpe/imported/w3c/web-platform-tests/dom/nodes/Document-createEvent.https-expected.txt: * resources/idlharness.js: Remove asserts that are commented out in upstream. * svg/dom/svg2-inheritance.html: * transforms/2d/transform-value-types-expected.txt: * transforms/2d/transform-value-types.html: Canonical link: https://commits.webkit.org/224174@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260992 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-01 09:48:33 +00:00
Symbol(Symbol.toStringTag)
Web Inspector: Expanding event objects in console shows undefined for most values, it should have real values https://bugs.webkit.org/show_bug.cgi?id=137306 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-01-20 Reviewed by Timothy Hatcher. Source/JavaScriptCore: Provide another optional parameter to getProperties, to gather a list of all own and getter properties. * inspector/InjectedScript.cpp: (Inspector::InjectedScript::getProperties): * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getProperties): * inspector/agents/InspectorRuntimeAgent.h: * inspector/protocol/Runtime.json: Source/WebInspectorUI: When first expanding an object, show all the object's own properties and any getter properties that may be on its prototype chain. Now, we only fetch own properties, for __proto__ properties. * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.prototype.getOwnProperties): (WebInspector.RemoteObject.prototype.getOwnAndGetterProperties): (WebInspector.RemoteObject.prototype.getAllProperties): (WebInspector.RemoteObject.prototype.get hasChildren): Deleted. * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.ObjectPropertiesSection): (WebInspector.ObjectPropertiesSection.prototype.update): (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate): LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: Added. * inspector/model/remote-object-get-properties.html: Added. Canonical link: https://commits.webkit.org/158679@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178768 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-01-21 00:34:57 +00:00
toString
toLocaleString
valueOf
hasOwnProperty
propertyIsEnumerable
isPrototypeOf
__defineGetter__
__defineSetter__
__lookupGetter__
__lookupSetter__
__proto__
-----------------------------------------------------
-----------------------------------------------------
EXPRESSION: window.complexObject
type: object
description: SuperFoo
OWN PROPERTIES:
_bar
_foo
__proto__
Web Inspector: Make Getter/Setter RemoteObject property and ObjectPreview handling consistent https://bugs.webkit.org/show_bug.cgi?id=141587 Reviewed by Timothy Hatcher. Source/JavaScriptCore: Convert getProperties(ownAndGetterProperties) to getDisplayableProperties(). Mark PropertyDescriptors that are presumed to be native getters / bindings separately so that the frontend may display them differently. * inspector/InjectedScript.cpp: (Inspector::InjectedScript::getProperties): (Inspector::InjectedScript::getDisplayableProperties): * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getProperties): (Inspector::InspectorRuntimeAgent::getDisplayableProperties): * inspector/agents/InspectorRuntimeAgent.h: * inspector/protocol/Runtime.json: Source/WebInspectorUI: * UserInterface/Models/CallFrame.js: (WebInspector.CallFrame.prototype.collectScopeChainVariableNames): * UserInterface/Models/PropertyDescriptor.js: (WebInspector.PropertyDescriptor.prototype.get nativeGetter): * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.fromPayload): (WebInspector.RemoteObject.prototype.getOwnPropertyDescriptors): (WebInspector.RemoteObject.prototype.getAllPropertyDescriptors): (WebInspector.RemoteObject.prototype.getDisplayablePropertyDescriptors): (WebInspector.RemoteObject.prototype._getPropertyDescriptors): (WebInspector.RemoteObject.prototype.if): (WebInspector.RemoteObject.prototype.deprecatedGetOwnProperties): (WebInspector.RemoteObject.prototype.deprecatedGetAllProperties): (WebInspector.RemoteObject.prototype._deprecatedGetProperties): (WebInspector.RemoteObject.prototype.getOwnAndGetterPropertyDescriptors): Deleted. (WebInspector.RemoteObject.prototype.callback): Deleted. (WebInspector.RemoteObject.prototype.getOwnProperties): Deleted. (WebInspector.RemoteObject.prototype.getOwnAndGetterProperties): Deleted. (WebInspector.RemoteObject.prototype.getAllProperties): Deleted. (WebInspector.RemoteObject.prototype.set else): Deleted. * UserInterface/Views/ConsoleMessageImpl.js: (WebInspector.ConsoleMessageImpl.prototype._formatParameterAsArray): * UserInterface/Views/DOMNodeDetailsSidebarPanel.js: (WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshProperties.nodePrototypesReady): * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.ObjectPropertiesSection.prototype.update): (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate): * UserInterface/Views/ObjectTreePropertyTreeElement.js: (WebInspector.ObjectTreePropertyTreeElement.prototype.): (WebInspector.ObjectTreePropertyTreeElement.prototype): * UserInterface/Views/ObjectTreeView.js: (WebInspector.ObjectTreeView.prototype.update): LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: * inspector/model/remote-object-get-properties.html: Canonical link: https://commits.webkit.org/160009@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180594 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-02-25 00:31:42 +00:00
DISPLAYABLE PROPERTIES:
Web Inspector: Expanding event objects in console shows undefined for most values, it should have real values https://bugs.webkit.org/show_bug.cgi?id=137306 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-01-20 Reviewed by Timothy Hatcher. Source/JavaScriptCore: Provide another optional parameter to getProperties, to gather a list of all own and getter properties. * inspector/InjectedScript.cpp: (Inspector::InjectedScript::getProperties): * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getProperties): * inspector/agents/InspectorRuntimeAgent.h: * inspector/protocol/Runtime.json: Source/WebInspectorUI: When first expanding an object, show all the object's own properties and any getter properties that may be on its prototype chain. Now, we only fetch own properties, for __proto__ properties. * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.prototype.getOwnProperties): (WebInspector.RemoteObject.prototype.getOwnAndGetterProperties): (WebInspector.RemoteObject.prototype.getAllProperties): (WebInspector.RemoteObject.prototype.get hasChildren): Deleted. * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.ObjectPropertiesSection): (WebInspector.ObjectPropertiesSection.prototype.update): (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate): LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: Added. * inspector/model/remote-object-get-properties.html: Added. Canonical link: https://commits.webkit.org/158679@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178768 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-01-21 00:34:57 +00:00
_bar
_foo
__proto__
ALL PROPERTIES:
_bar
_foo
constructor
Web Inspector: Create Separate Model and View Objects for RemoteObjects / ObjectPreview / PropertyDescriptor https://bugs.webkit.org/show_bug.cgi?id=141696 Reviewed by Timothy Hatcher. Source/WebInspectorUI: * UserInterface/Main.html: Add new files. * UserInterface/Models/CollectionEntry.js: Added. (WebInspector.CollectionEntry): (WebInspector.CollectionEntry.fromPayload): (WebInspector.CollectionEntry.prototype.get key): (WebInspector.CollectionEntry.prototype.get value): * UserInterface/Models/CollectionEntryPreview.js: Added. (WebInspector.CollectionEntryPreview): (WebInspector.CollectionEntryPreview.fromPayload): (WebInspector.CollectionEntryPreview.prototype.get keyPreview): (WebInspector.CollectionEntryPreview.prototype.get valuePreview): * UserInterface/Models/ObjectPreview.js: Added. (WebInspector.ObjectPreview): (WebInspector.ObjectPreview.fromPayload): (WebInspector.ObjectPreview.prototype.get type): (WebInspector.ObjectPreview.prototype.get subtype): (WebInspector.ObjectPreview.prototype.get description): (WebInspector.ObjectPreview.prototype.get lossless): (WebInspector.ObjectPreview.prototype.get overflow): (WebInspector.ObjectPreview.prototype.get properties): (WebInspector.ObjectPreview.prototype.get entries): * UserInterface/Models/PropertyPreview.js: Added. (WebInspector.PropertyPreview): (WebInspector.PropertyPreview.fromPayload): (WebInspector.PropertyPreview.prototype.get name): (WebInspector.PropertyPreview.prototype.get type): (WebInspector.PropertyPreview.prototype.get subtype): (WebInspector.PropertyPreview.prototype.get value): (WebInspector.PropertyPreview.prototype.get valuePreview): * UserInterface/Models/PropertyDescriptor.js: Added. (WebInspector.PropertyDescriptor.fromPayload): (WebInspector.PropertyDescriptor.prototype.get name): (WebInspector.PropertyDescriptor.prototype.get value): (WebInspector.PropertyDescriptor.prototype.get writable): (WebInspector.PropertyDescriptor.prototype.get configurable): (WebInspector.PropertyDescriptor.prototype.get enumerable): (WebInspector.PropertyDescriptor.prototype.get isOwnProperty): (WebInspector.PropertyDescriptor.prototype.get wasThrown): (WebInspector.PropertyDescriptor.prototype.get isInternalProperty): (WebInspector.PropertyDescriptor.prototype.hasValue): (WebInspector.PropertyDescriptor.prototype.hasGetter): (WebInspector.PropertyDescriptor.prototype.hasSetter): New Model objects for different Protocol types. The only customizations right now are compatibility modifications and PropertyDescriptor's "hasValue", "hasGetter", and "hasSetter" functions to return reliable checks based on the descriptors contents. * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject): (WebInspector.RemoteObject.fromPayload): (WebInspector.RemoteObject.resolveNode): (WebInspector.RemoteObject.prototype.get value): (WebInspector.RemoteObject.prototype._isSymbol): (WebInspector.RemoteObject.prototype.isCollectionType): (WebInspector.RemoteObject.prototype.isWeakCollection): (WebInspector.RemoteObject.prototype.getCollectionEntries): (WebInspector.RemoteObject.prototype.arrayLength): Clean up the existing code to enforce more checks and use our style of member variables and public accessors. (WebInspector.RemoteObject.prototype.getOwnPropertyDescriptors): (WebInspector.RemoteObject.prototype.getOwnAndGetterPropertyDescriptors): (WebInspector.RemoteObject.prototype.getAllPropertyDescriptors): (WebInspector.RemoteObject.prototype.callback): Provide a new way of getting properties that returns Model objects instead of raw protocol types. * UserInterface/Views/ConsoleMessageImpl.js: (WebInspector.ConsoleMessageImpl.prototype._format): (WebInspector.ConsoleMessageImpl.prototype._formatParameter): (WebInspector.ConsoleMessageImpl.prototype._propertyPreviewElement): (WebInspector.ConsoleMessageImpl.prototype._formatParameterAsNode): (WebInspector.ConsoleMessageImpl.prototype._formatParameterAsTable): (WebInspector.ConsoleMessageImpl.prototype._formatAsArrayEntry): Always include a preview when possible. Now, when forced to be an object, force expansion even if the preview is lossless. (WebInspector.ConsoleMessageImpl.prototype._formatParameterAsObject): Use an ObjectTreeView instead of ObjectPropertiesSection. (WebInspector.ConsoleMessageImpl.prototype._appendPreview): Deleted. (WebInspector.ConsoleMessageImpl.prototype._appendEntryPreviews): Deleted. (WebInspector.ConsoleMessageImpl.prototype._appendPropertyPreviews): Deleted. (WebInspector.ConsoleMessageImpl.prototype._appendValuePreview): Deleted. This code is moved into ObjectPreviewView. * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.CollectionEntriesMainTreeElement.prototype.onexpand.callback): (WebInspector.CollectionEntriesMainTreeElement.prototype.onexpand): These types are now converted to Model types in Model objects, so do not do it here. * UserInterface/Views/ObjectPreviewView.css: Added. (.object-preview): (.object-preview.lossless): (.object-preview .name): * UserInterface/Views/ObjectPreviewView.js: Added. (WebInspector.ObjectPreviewView): (WebInspector.ObjectPreviewView.prototype.get preview): (WebInspector.ObjectPreviewView.prototype.get element): (WebInspector.ObjectPreviewView.prototype.get mode): (WebInspector.ObjectPreviewView.prototype.get lossless): (WebInspector.ObjectPreviewView.prototype._numberOfPropertiesToShowInMode): (WebInspector.ObjectPreviewView.prototype._appendPreview): (WebInspector.ObjectPreviewView.prototype._appendEntryPreviews): (WebInspector.ObjectPreviewView.prototype._appendPropertyPreviews): (WebInspector.ObjectPreviewView.prototype._appendValuePreview): (WebInspector.ObjectPreviewView.prototype._formattedObjectElementForPreview): An ObjectPreviewView can create a full/brief view given a ObjectPreview. The view will contain formatted values everywhere possible. * UserInterface/Views/ObjectTreePropertyTreeElement.js: Added. (WebInspector.ObjectTreePropertyTreeElement): (WebInspector.ObjectTreePropertyTreeElement.prototype.get property): (WebInspector.ObjectTreePropertyTreeElement.prototype.onpopulate): (WebInspector.ObjectTreePropertyTreeElement.prototype.onattach): (WebInspector.ObjectTreePropertyTreeElement.prototype._updateTitle): (WebInspector.ObjectTreePropertyTreeElement.prototype._updateTitlePropertyStyle): (WebInspector.ObjectTreePropertyTreeElement.prototype._updateTitleAPIStyle): (WebInspector.ObjectTreePropertyTreeElement.prototype._descriptionString): (WebInspector.ObjectTreePropertyTreeElement.prototype._functionParameterString): (WebInspector.ObjectTreePropertyTreeElement.prototype.mode): (WebInspector.ObjectTreePropertyTreeElement.prototype): * UserInterface/Views/ObjectTreeView.js: Added. (WebInspector.ObjectTreeView): (WebInspector.ObjectTreeView.classNameForObject): (WebInspector.ObjectTreeView.ComparePropertyDescriptors): (WebInspector.ObjectTreeView.prototype.get object): (WebInspector.ObjectTreeView.prototype.get element): (WebInspector.ObjectTreeView.prototype.get expanded): (WebInspector.ObjectTreeView.prototype.expand): (WebInspector.ObjectTreeView.prototype.collapse): (WebInspector.ObjectTreeView.prototype.update): (WebInspector.ObjectTreeView.prototype._updateProperties): (WebInspector.ObjectTreeView.prototype._handlePreviewOrTitleElementClick): Re-implementation of ObjectPropertiesSection for our Model objects without "Section" semantics / dependencies. An ObjectTree will creates an expandable tree for a RemoteObject. The top level clickable item will be an ObjectPreview if possible, otherwise just a title element. * UserInterface/Views/ObjectTreeView.css: Added. (.object-tree): (.object-tree > .title): (.object-tree > :matches(.title, .object-preview)::before): (.object-tree.expanded > :matches(.title, .object-preview)::before): (.object-tree.lossless-preview > :matches(.title, .object-preview)::before): (.object-tree-outline): (.object-tree.expanded > .object-tree-outline): (.object-tree-outline li): (.object-tree-outline li.parent): (.object-tree-outline li.parent::before): (.object-tree-outline li.parent.expanded::before): (.object-tree-outline ol): (.object-tree-outline ol.expanded): (.object-tree-outline li .empty-message): (.object-tree-property .name): (.object-tree-property .name.not-enumerable): (.object-tree-property .value.error): (.formatted-object, .formatted-node, .formatted-error, .formatted-map, .formatted-set, .formatted-weakmap): (.formatted-number): (.formatted-string, .formatted-regexp): (.formatted-string): (.formatted-regexp): (.formatted-symbol): (.formatted-null, .formatted-undefined): (.console-group-messages .object-tree:not(.lossless-preview)): (.console-group-messages .object-tree:not(.lossless-preview) > :matches(.title, .object-preview)): (.console-group-messages .object-tree:not(.lossless-preview) > :matches(.title, .object-preview)::before): (.console-group-messages :matches(.console-formatted-object, .console-formatted-node, .console-formatted-error, .console-formatted-map, .console-formatted-set, .console-formatted-weakmap) .object-tree): (.console-group-messages :matches(.console-formatted-object, .console-formatted-node, .console-formatted-error, .console-formatted-map, .console-formatted-set, .console-formatted-weakmap) .object-tree-outline): All styles for ObjectTree / ObjectPreview. Independent from other styles in the inspector. Most of this is a copy of the styles applied to ObjectPropertiesSection, renamed. * UserInterface/Views/ObjectTreeCollectionTreeElement.js: Added. (WebInspector.ObjectTreeCollectionTreeElement): (WebInspector.ObjectTreeCollectionTreeElement.propertyDescriptorForEntry): (WebInspector.ObjectTreeCollectionTreeElement.prototype.get remoteObject): (WebInspector.ObjectTreeCollectionTreeElement.prototype.onexpand.callback): (WebInspector.ObjectTreeCollectionTreeElement.prototype.onexpand): (WebInspector.ObjectTreeCollectionTreeElement.prototype.oncollapse): (WebInspector.ObjectTreeCollectionTreeElement.prototype.ondetach): (WebInspector.ObjectTreeCollectionTreeElement.prototype._trackWeakEntries): (WebInspector.ObjectTreeCollectionTreeElement.prototype._untrackWeakEntries): (WebInspector.ObjectTreeCollectionEntryTreeElement): (WebInspector.ObjectTreeCollectionEntryTreeElement.prototype.onpopulate): (WebInspector.ObjectTreeCollectionEntryTreeElement.prototype.onattach): (WebInspector.ObjectTreeEmptyCollectionTreeElement): Essentially a copy of ObjectPropertiesSection Collection handling using the ObjectTree class names. * UserInterface/Views/TreeOutlineDataGridSynchronizer.js: Fix prototype typo. LayoutTests: * inspector/model/remote-object-expected.txt: * inspector/model/remote-object-get-properties-expected.txt: * inspector/model/remote-object-get-properties.html: * inspector/model/remote-object-weak-collection-expected.txt: * inspector/model/remote-object-weak-collection.html: Update tests and results to use our Model objects and not raw protocol types. Canonical link: https://commits.webkit.org/159826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180356 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-02-19 20:25:04 +00:00
getterProperty
foo
Web Inspector: Expanding event objects in console shows undefined for most values, it should have real values https://bugs.webkit.org/show_bug.cgi?id=137306 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-01-20 Reviewed by Timothy Hatcher. Source/JavaScriptCore: Provide another optional parameter to getProperties, to gather a list of all own and getter properties. * inspector/InjectedScript.cpp: (Inspector::InjectedScript::getProperties): * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getProperties): * inspector/agents/InspectorRuntimeAgent.h: * inspector/protocol/Runtime.json: Source/WebInspectorUI: When first expanding an object, show all the object's own properties and any getter properties that may be on its prototype chain. Now, we only fetch own properties, for __proto__ properties. * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.prototype.getOwnProperties): (WebInspector.RemoteObject.prototype.getOwnAndGetterProperties): (WebInspector.RemoteObject.prototype.getAllProperties): (WebInspector.RemoteObject.prototype.get hasChildren): Deleted. * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.ObjectPropertiesSection): (WebInspector.ObjectPropertiesSection.prototype.update): (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate): LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: Added. * inspector/model/remote-object-get-properties.html: Added. Canonical link: https://commits.webkit.org/158679@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178768 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-01-21 00:34:57 +00:00
BAR_CONSTANT
Web Inspector: Create Separate Model and View Objects for RemoteObjects / ObjectPreview / PropertyDescriptor https://bugs.webkit.org/show_bug.cgi?id=141696 Reviewed by Timothy Hatcher. Source/WebInspectorUI: * UserInterface/Main.html: Add new files. * UserInterface/Models/CollectionEntry.js: Added. (WebInspector.CollectionEntry): (WebInspector.CollectionEntry.fromPayload): (WebInspector.CollectionEntry.prototype.get key): (WebInspector.CollectionEntry.prototype.get value): * UserInterface/Models/CollectionEntryPreview.js: Added. (WebInspector.CollectionEntryPreview): (WebInspector.CollectionEntryPreview.fromPayload): (WebInspector.CollectionEntryPreview.prototype.get keyPreview): (WebInspector.CollectionEntryPreview.prototype.get valuePreview): * UserInterface/Models/ObjectPreview.js: Added. (WebInspector.ObjectPreview): (WebInspector.ObjectPreview.fromPayload): (WebInspector.ObjectPreview.prototype.get type): (WebInspector.ObjectPreview.prototype.get subtype): (WebInspector.ObjectPreview.prototype.get description): (WebInspector.ObjectPreview.prototype.get lossless): (WebInspector.ObjectPreview.prototype.get overflow): (WebInspector.ObjectPreview.prototype.get properties): (WebInspector.ObjectPreview.prototype.get entries): * UserInterface/Models/PropertyPreview.js: Added. (WebInspector.PropertyPreview): (WebInspector.PropertyPreview.fromPayload): (WebInspector.PropertyPreview.prototype.get name): (WebInspector.PropertyPreview.prototype.get type): (WebInspector.PropertyPreview.prototype.get subtype): (WebInspector.PropertyPreview.prototype.get value): (WebInspector.PropertyPreview.prototype.get valuePreview): * UserInterface/Models/PropertyDescriptor.js: Added. (WebInspector.PropertyDescriptor.fromPayload): (WebInspector.PropertyDescriptor.prototype.get name): (WebInspector.PropertyDescriptor.prototype.get value): (WebInspector.PropertyDescriptor.prototype.get writable): (WebInspector.PropertyDescriptor.prototype.get configurable): (WebInspector.PropertyDescriptor.prototype.get enumerable): (WebInspector.PropertyDescriptor.prototype.get isOwnProperty): (WebInspector.PropertyDescriptor.prototype.get wasThrown): (WebInspector.PropertyDescriptor.prototype.get isInternalProperty): (WebInspector.PropertyDescriptor.prototype.hasValue): (WebInspector.PropertyDescriptor.prototype.hasGetter): (WebInspector.PropertyDescriptor.prototype.hasSetter): New Model objects for different Protocol types. The only customizations right now are compatibility modifications and PropertyDescriptor's "hasValue", "hasGetter", and "hasSetter" functions to return reliable checks based on the descriptors contents. * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject): (WebInspector.RemoteObject.fromPayload): (WebInspector.RemoteObject.resolveNode): (WebInspector.RemoteObject.prototype.get value): (WebInspector.RemoteObject.prototype._isSymbol): (WebInspector.RemoteObject.prototype.isCollectionType): (WebInspector.RemoteObject.prototype.isWeakCollection): (WebInspector.RemoteObject.prototype.getCollectionEntries): (WebInspector.RemoteObject.prototype.arrayLength): Clean up the existing code to enforce more checks and use our style of member variables and public accessors. (WebInspector.RemoteObject.prototype.getOwnPropertyDescriptors): (WebInspector.RemoteObject.prototype.getOwnAndGetterPropertyDescriptors): (WebInspector.RemoteObject.prototype.getAllPropertyDescriptors): (WebInspector.RemoteObject.prototype.callback): Provide a new way of getting properties that returns Model objects instead of raw protocol types. * UserInterface/Views/ConsoleMessageImpl.js: (WebInspector.ConsoleMessageImpl.prototype._format): (WebInspector.ConsoleMessageImpl.prototype._formatParameter): (WebInspector.ConsoleMessageImpl.prototype._propertyPreviewElement): (WebInspector.ConsoleMessageImpl.prototype._formatParameterAsNode): (WebInspector.ConsoleMessageImpl.prototype._formatParameterAsTable): (WebInspector.ConsoleMessageImpl.prototype._formatAsArrayEntry): Always include a preview when possible. Now, when forced to be an object, force expansion even if the preview is lossless. (WebInspector.ConsoleMessageImpl.prototype._formatParameterAsObject): Use an ObjectTreeView instead of ObjectPropertiesSection. (WebInspector.ConsoleMessageImpl.prototype._appendPreview): Deleted. (WebInspector.ConsoleMessageImpl.prototype._appendEntryPreviews): Deleted. (WebInspector.ConsoleMessageImpl.prototype._appendPropertyPreviews): Deleted. (WebInspector.ConsoleMessageImpl.prototype._appendValuePreview): Deleted. This code is moved into ObjectPreviewView. * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.CollectionEntriesMainTreeElement.prototype.onexpand.callback): (WebInspector.CollectionEntriesMainTreeElement.prototype.onexpand): These types are now converted to Model types in Model objects, so do not do it here. * UserInterface/Views/ObjectPreviewView.css: Added. (.object-preview): (.object-preview.lossless): (.object-preview .name): * UserInterface/Views/ObjectPreviewView.js: Added. (WebInspector.ObjectPreviewView): (WebInspector.ObjectPreviewView.prototype.get preview): (WebInspector.ObjectPreviewView.prototype.get element): (WebInspector.ObjectPreviewView.prototype.get mode): (WebInspector.ObjectPreviewView.prototype.get lossless): (WebInspector.ObjectPreviewView.prototype._numberOfPropertiesToShowInMode): (WebInspector.ObjectPreviewView.prototype._appendPreview): (WebInspector.ObjectPreviewView.prototype._appendEntryPreviews): (WebInspector.ObjectPreviewView.prototype._appendPropertyPreviews): (WebInspector.ObjectPreviewView.prototype._appendValuePreview): (WebInspector.ObjectPreviewView.prototype._formattedObjectElementForPreview): An ObjectPreviewView can create a full/brief view given a ObjectPreview. The view will contain formatted values everywhere possible. * UserInterface/Views/ObjectTreePropertyTreeElement.js: Added. (WebInspector.ObjectTreePropertyTreeElement): (WebInspector.ObjectTreePropertyTreeElement.prototype.get property): (WebInspector.ObjectTreePropertyTreeElement.prototype.onpopulate): (WebInspector.ObjectTreePropertyTreeElement.prototype.onattach): (WebInspector.ObjectTreePropertyTreeElement.prototype._updateTitle): (WebInspector.ObjectTreePropertyTreeElement.prototype._updateTitlePropertyStyle): (WebInspector.ObjectTreePropertyTreeElement.prototype._updateTitleAPIStyle): (WebInspector.ObjectTreePropertyTreeElement.prototype._descriptionString): (WebInspector.ObjectTreePropertyTreeElement.prototype._functionParameterString): (WebInspector.ObjectTreePropertyTreeElement.prototype.mode): (WebInspector.ObjectTreePropertyTreeElement.prototype): * UserInterface/Views/ObjectTreeView.js: Added. (WebInspector.ObjectTreeView): (WebInspector.ObjectTreeView.classNameForObject): (WebInspector.ObjectTreeView.ComparePropertyDescriptors): (WebInspector.ObjectTreeView.prototype.get object): (WebInspector.ObjectTreeView.prototype.get element): (WebInspector.ObjectTreeView.prototype.get expanded): (WebInspector.ObjectTreeView.prototype.expand): (WebInspector.ObjectTreeView.prototype.collapse): (WebInspector.ObjectTreeView.prototype.update): (WebInspector.ObjectTreeView.prototype._updateProperties): (WebInspector.ObjectTreeView.prototype._handlePreviewOrTitleElementClick): Re-implementation of ObjectPropertiesSection for our Model objects without "Section" semantics / dependencies. An ObjectTree will creates an expandable tree for a RemoteObject. The top level clickable item will be an ObjectPreview if possible, otherwise just a title element. * UserInterface/Views/ObjectTreeView.css: Added. (.object-tree): (.object-tree > .title): (.object-tree > :matches(.title, .object-preview)::before): (.object-tree.expanded > :matches(.title, .object-preview)::before): (.object-tree.lossless-preview > :matches(.title, .object-preview)::before): (.object-tree-outline): (.object-tree.expanded > .object-tree-outline): (.object-tree-outline li): (.object-tree-outline li.parent): (.object-tree-outline li.parent::before): (.object-tree-outline li.parent.expanded::before): (.object-tree-outline ol): (.object-tree-outline ol.expanded): (.object-tree-outline li .empty-message): (.object-tree-property .name): (.object-tree-property .name.not-enumerable): (.object-tree-property .value.error): (.formatted-object, .formatted-node, .formatted-error, .formatted-map, .formatted-set, .formatted-weakmap): (.formatted-number): (.formatted-string, .formatted-regexp): (.formatted-string): (.formatted-regexp): (.formatted-symbol): (.formatted-null, .formatted-undefined): (.console-group-messages .object-tree:not(.lossless-preview)): (.console-group-messages .object-tree:not(.lossless-preview) > :matches(.title, .object-preview)): (.console-group-messages .object-tree:not(.lossless-preview) > :matches(.title, .object-preview)::before): (.console-group-messages :matches(.console-formatted-object, .console-formatted-node, .console-formatted-error, .console-formatted-map, .console-formatted-set, .console-formatted-weakmap) .object-tree): (.console-group-messages :matches(.console-formatted-object, .console-formatted-node, .console-formatted-error, .console-formatted-map, .console-formatted-set, .console-formatted-weakmap) .object-tree-outline): All styles for ObjectTree / ObjectPreview. Independent from other styles in the inspector. Most of this is a copy of the styles applied to ObjectPropertiesSection, renamed. * UserInterface/Views/ObjectTreeCollectionTreeElement.js: Added. (WebInspector.ObjectTreeCollectionTreeElement): (WebInspector.ObjectTreeCollectionTreeElement.propertyDescriptorForEntry): (WebInspector.ObjectTreeCollectionTreeElement.prototype.get remoteObject): (WebInspector.ObjectTreeCollectionTreeElement.prototype.onexpand.callback): (WebInspector.ObjectTreeCollectionTreeElement.prototype.onexpand): (WebInspector.ObjectTreeCollectionTreeElement.prototype.oncollapse): (WebInspector.ObjectTreeCollectionTreeElement.prototype.ondetach): (WebInspector.ObjectTreeCollectionTreeElement.prototype._trackWeakEntries): (WebInspector.ObjectTreeCollectionTreeElement.prototype._untrackWeakEntries): (WebInspector.ObjectTreeCollectionEntryTreeElement): (WebInspector.ObjectTreeCollectionEntryTreeElement.prototype.onpopulate): (WebInspector.ObjectTreeCollectionEntryTreeElement.prototype.onattach): (WebInspector.ObjectTreeEmptyCollectionTreeElement): Essentially a copy of ObjectPropertiesSection Collection handling using the ObjectTree class names. * UserInterface/Views/TreeOutlineDataGridSynchronizer.js: Fix prototype typo. LayoutTests: * inspector/model/remote-object-expected.txt: * inspector/model/remote-object-get-properties-expected.txt: * inspector/model/remote-object-get-properties.html: * inspector/model/remote-object-weak-collection-expected.txt: * inspector/model/remote-object-weak-collection.html: Update tests and results to use our Model objects and not raw protocol types. Canonical link: https://commits.webkit.org/159826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180356 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-02-19 20:25:04 +00:00
bar
setterOnly
Web Inspector: Expanding event objects in console shows undefined for most values, it should have real values https://bugs.webkit.org/show_bug.cgi?id=137306 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-01-20 Reviewed by Timothy Hatcher. Source/JavaScriptCore: Provide another optional parameter to getProperties, to gather a list of all own and getter properties. * inspector/InjectedScript.cpp: (Inspector::InjectedScript::getProperties): * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getProperties): * inspector/agents/InspectorRuntimeAgent.h: * inspector/protocol/Runtime.json: Source/WebInspectorUI: When first expanding an object, show all the object's own properties and any getter properties that may be on its prototype chain. Now, we only fetch own properties, for __proto__ properties. * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.prototype.getOwnProperties): (WebInspector.RemoteObject.prototype.getOwnAndGetterProperties): (WebInspector.RemoteObject.prototype.getAllProperties): (WebInspector.RemoteObject.prototype.get hasChildren): Deleted. * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.ObjectPropertiesSection): (WebInspector.ObjectPropertiesSection.prototype.update): (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate): LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: Added. * inspector/model/remote-object-get-properties.html: Added. Canonical link: https://commits.webkit.org/158679@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178768 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-01-21 00:34:57 +00:00
toString
toLocaleString
valueOf
hasOwnProperty
propertyIsEnumerable
isPrototypeOf
__defineGetter__
__defineSetter__
__lookupGetter__
__lookupSetter__
__proto__
-----------------------------------------------------
-----------------------------------------------------
EXPRESSION: window.badGetterObject
type: object
description: ClassWithBadGetter
OWN PROPERTIES:
__proto__
Web Inspector: Make Getter/Setter RemoteObject property and ObjectPreview handling consistent https://bugs.webkit.org/show_bug.cgi?id=141587 Reviewed by Timothy Hatcher. Source/JavaScriptCore: Convert getProperties(ownAndGetterProperties) to getDisplayableProperties(). Mark PropertyDescriptors that are presumed to be native getters / bindings separately so that the frontend may display them differently. * inspector/InjectedScript.cpp: (Inspector::InjectedScript::getProperties): (Inspector::InjectedScript::getDisplayableProperties): * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getProperties): (Inspector::InspectorRuntimeAgent::getDisplayableProperties): * inspector/agents/InspectorRuntimeAgent.h: * inspector/protocol/Runtime.json: Source/WebInspectorUI: * UserInterface/Models/CallFrame.js: (WebInspector.CallFrame.prototype.collectScopeChainVariableNames): * UserInterface/Models/PropertyDescriptor.js: (WebInspector.PropertyDescriptor.prototype.get nativeGetter): * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.fromPayload): (WebInspector.RemoteObject.prototype.getOwnPropertyDescriptors): (WebInspector.RemoteObject.prototype.getAllPropertyDescriptors): (WebInspector.RemoteObject.prototype.getDisplayablePropertyDescriptors): (WebInspector.RemoteObject.prototype._getPropertyDescriptors): (WebInspector.RemoteObject.prototype.if): (WebInspector.RemoteObject.prototype.deprecatedGetOwnProperties): (WebInspector.RemoteObject.prototype.deprecatedGetAllProperties): (WebInspector.RemoteObject.prototype._deprecatedGetProperties): (WebInspector.RemoteObject.prototype.getOwnAndGetterPropertyDescriptors): Deleted. (WebInspector.RemoteObject.prototype.callback): Deleted. (WebInspector.RemoteObject.prototype.getOwnProperties): Deleted. (WebInspector.RemoteObject.prototype.getOwnAndGetterProperties): Deleted. (WebInspector.RemoteObject.prototype.getAllProperties): Deleted. (WebInspector.RemoteObject.prototype.set else): Deleted. * UserInterface/Views/ConsoleMessageImpl.js: (WebInspector.ConsoleMessageImpl.prototype._formatParameterAsArray): * UserInterface/Views/DOMNodeDetailsSidebarPanel.js: (WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshProperties.nodePrototypesReady): * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.ObjectPropertiesSection.prototype.update): (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate): * UserInterface/Views/ObjectTreePropertyTreeElement.js: (WebInspector.ObjectTreePropertyTreeElement.prototype.): (WebInspector.ObjectTreePropertyTreeElement.prototype): * UserInterface/Views/ObjectTreeView.js: (WebInspector.ObjectTreeView.prototype.update): LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: * inspector/model/remote-object-get-properties.html: Canonical link: https://commits.webkit.org/160009@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180594 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-02-25 00:31:42 +00:00
DISPLAYABLE PROPERTIES:
Web Inspector: Expanding event objects in console shows undefined for most values, it should have real values https://bugs.webkit.org/show_bug.cgi?id=137306 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-01-20 Reviewed by Timothy Hatcher. Source/JavaScriptCore: Provide another optional parameter to getProperties, to gather a list of all own and getter properties. * inspector/InjectedScript.cpp: (Inspector::InjectedScript::getProperties): * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getProperties): * inspector/agents/InspectorRuntimeAgent.h: * inspector/protocol/Runtime.json: Source/WebInspectorUI: When first expanding an object, show all the object's own properties and any getter properties that may be on its prototype chain. Now, we only fetch own properties, for __proto__ properties. * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.prototype.getOwnProperties): (WebInspector.RemoteObject.prototype.getOwnAndGetterProperties): (WebInspector.RemoteObject.prototype.getAllProperties): (WebInspector.RemoteObject.prototype.get hasChildren): Deleted. * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.ObjectPropertiesSection): (WebInspector.ObjectPropertiesSection.prototype.update): (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate): LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: Added. * inspector/model/remote-object-get-properties.html: Added. Canonical link: https://commits.webkit.org/158679@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178768 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-01-21 00:34:57 +00:00
__proto__
ALL PROPERTIES:
constructor
Web Inspector: Create Separate Model and View Objects for RemoteObjects / ObjectPreview / PropertyDescriptor https://bugs.webkit.org/show_bug.cgi?id=141696 Reviewed by Timothy Hatcher. Source/WebInspectorUI: * UserInterface/Main.html: Add new files. * UserInterface/Models/CollectionEntry.js: Added. (WebInspector.CollectionEntry): (WebInspector.CollectionEntry.fromPayload): (WebInspector.CollectionEntry.prototype.get key): (WebInspector.CollectionEntry.prototype.get value): * UserInterface/Models/CollectionEntryPreview.js: Added. (WebInspector.CollectionEntryPreview): (WebInspector.CollectionEntryPreview.fromPayload): (WebInspector.CollectionEntryPreview.prototype.get keyPreview): (WebInspector.CollectionEntryPreview.prototype.get valuePreview): * UserInterface/Models/ObjectPreview.js: Added. (WebInspector.ObjectPreview): (WebInspector.ObjectPreview.fromPayload): (WebInspector.ObjectPreview.prototype.get type): (WebInspector.ObjectPreview.prototype.get subtype): (WebInspector.ObjectPreview.prototype.get description): (WebInspector.ObjectPreview.prototype.get lossless): (WebInspector.ObjectPreview.prototype.get overflow): (WebInspector.ObjectPreview.prototype.get properties): (WebInspector.ObjectPreview.prototype.get entries): * UserInterface/Models/PropertyPreview.js: Added. (WebInspector.PropertyPreview): (WebInspector.PropertyPreview.fromPayload): (WebInspector.PropertyPreview.prototype.get name): (WebInspector.PropertyPreview.prototype.get type): (WebInspector.PropertyPreview.prototype.get subtype): (WebInspector.PropertyPreview.prototype.get value): (WebInspector.PropertyPreview.prototype.get valuePreview): * UserInterface/Models/PropertyDescriptor.js: Added. (WebInspector.PropertyDescriptor.fromPayload): (WebInspector.PropertyDescriptor.prototype.get name): (WebInspector.PropertyDescriptor.prototype.get value): (WebInspector.PropertyDescriptor.prototype.get writable): (WebInspector.PropertyDescriptor.prototype.get configurable): (WebInspector.PropertyDescriptor.prototype.get enumerable): (WebInspector.PropertyDescriptor.prototype.get isOwnProperty): (WebInspector.PropertyDescriptor.prototype.get wasThrown): (WebInspector.PropertyDescriptor.prototype.get isInternalProperty): (WebInspector.PropertyDescriptor.prototype.hasValue): (WebInspector.PropertyDescriptor.prototype.hasGetter): (WebInspector.PropertyDescriptor.prototype.hasSetter): New Model objects for different Protocol types. The only customizations right now are compatibility modifications and PropertyDescriptor's "hasValue", "hasGetter", and "hasSetter" functions to return reliable checks based on the descriptors contents. * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject): (WebInspector.RemoteObject.fromPayload): (WebInspector.RemoteObject.resolveNode): (WebInspector.RemoteObject.prototype.get value): (WebInspector.RemoteObject.prototype._isSymbol): (WebInspector.RemoteObject.prototype.isCollectionType): (WebInspector.RemoteObject.prototype.isWeakCollection): (WebInspector.RemoteObject.prototype.getCollectionEntries): (WebInspector.RemoteObject.prototype.arrayLength): Clean up the existing code to enforce more checks and use our style of member variables and public accessors. (WebInspector.RemoteObject.prototype.getOwnPropertyDescriptors): (WebInspector.RemoteObject.prototype.getOwnAndGetterPropertyDescriptors): (WebInspector.RemoteObject.prototype.getAllPropertyDescriptors): (WebInspector.RemoteObject.prototype.callback): Provide a new way of getting properties that returns Model objects instead of raw protocol types. * UserInterface/Views/ConsoleMessageImpl.js: (WebInspector.ConsoleMessageImpl.prototype._format): (WebInspector.ConsoleMessageImpl.prototype._formatParameter): (WebInspector.ConsoleMessageImpl.prototype._propertyPreviewElement): (WebInspector.ConsoleMessageImpl.prototype._formatParameterAsNode): (WebInspector.ConsoleMessageImpl.prototype._formatParameterAsTable): (WebInspector.ConsoleMessageImpl.prototype._formatAsArrayEntry): Always include a preview when possible. Now, when forced to be an object, force expansion even if the preview is lossless. (WebInspector.ConsoleMessageImpl.prototype._formatParameterAsObject): Use an ObjectTreeView instead of ObjectPropertiesSection. (WebInspector.ConsoleMessageImpl.prototype._appendPreview): Deleted. (WebInspector.ConsoleMessageImpl.prototype._appendEntryPreviews): Deleted. (WebInspector.ConsoleMessageImpl.prototype._appendPropertyPreviews): Deleted. (WebInspector.ConsoleMessageImpl.prototype._appendValuePreview): Deleted. This code is moved into ObjectPreviewView. * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.CollectionEntriesMainTreeElement.prototype.onexpand.callback): (WebInspector.CollectionEntriesMainTreeElement.prototype.onexpand): These types are now converted to Model types in Model objects, so do not do it here. * UserInterface/Views/ObjectPreviewView.css: Added. (.object-preview): (.object-preview.lossless): (.object-preview .name): * UserInterface/Views/ObjectPreviewView.js: Added. (WebInspector.ObjectPreviewView): (WebInspector.ObjectPreviewView.prototype.get preview): (WebInspector.ObjectPreviewView.prototype.get element): (WebInspector.ObjectPreviewView.prototype.get mode): (WebInspector.ObjectPreviewView.prototype.get lossless): (WebInspector.ObjectPreviewView.prototype._numberOfPropertiesToShowInMode): (WebInspector.ObjectPreviewView.prototype._appendPreview): (WebInspector.ObjectPreviewView.prototype._appendEntryPreviews): (WebInspector.ObjectPreviewView.prototype._appendPropertyPreviews): (WebInspector.ObjectPreviewView.prototype._appendValuePreview): (WebInspector.ObjectPreviewView.prototype._formattedObjectElementForPreview): An ObjectPreviewView can create a full/brief view given a ObjectPreview. The view will contain formatted values everywhere possible. * UserInterface/Views/ObjectTreePropertyTreeElement.js: Added. (WebInspector.ObjectTreePropertyTreeElement): (WebInspector.ObjectTreePropertyTreeElement.prototype.get property): (WebInspector.ObjectTreePropertyTreeElement.prototype.onpopulate): (WebInspector.ObjectTreePropertyTreeElement.prototype.onattach): (WebInspector.ObjectTreePropertyTreeElement.prototype._updateTitle): (WebInspector.ObjectTreePropertyTreeElement.prototype._updateTitlePropertyStyle): (WebInspector.ObjectTreePropertyTreeElement.prototype._updateTitleAPIStyle): (WebInspector.ObjectTreePropertyTreeElement.prototype._descriptionString): (WebInspector.ObjectTreePropertyTreeElement.prototype._functionParameterString): (WebInspector.ObjectTreePropertyTreeElement.prototype.mode): (WebInspector.ObjectTreePropertyTreeElement.prototype): * UserInterface/Views/ObjectTreeView.js: Added. (WebInspector.ObjectTreeView): (WebInspector.ObjectTreeView.classNameForObject): (WebInspector.ObjectTreeView.ComparePropertyDescriptors): (WebInspector.ObjectTreeView.prototype.get object): (WebInspector.ObjectTreeView.prototype.get element): (WebInspector.ObjectTreeView.prototype.get expanded): (WebInspector.ObjectTreeView.prototype.expand): (WebInspector.ObjectTreeView.prototype.collapse): (WebInspector.ObjectTreeView.prototype.update): (WebInspector.ObjectTreeView.prototype._updateProperties): (WebInspector.ObjectTreeView.prototype._handlePreviewOrTitleElementClick): Re-implementation of ObjectPropertiesSection for our Model objects without "Section" semantics / dependencies. An ObjectTree will creates an expandable tree for a RemoteObject. The top level clickable item will be an ObjectPreview if possible, otherwise just a title element. * UserInterface/Views/ObjectTreeView.css: Added. (.object-tree): (.object-tree > .title): (.object-tree > :matches(.title, .object-preview)::before): (.object-tree.expanded > :matches(.title, .object-preview)::before): (.object-tree.lossless-preview > :matches(.title, .object-preview)::before): (.object-tree-outline): (.object-tree.expanded > .object-tree-outline): (.object-tree-outline li): (.object-tree-outline li.parent): (.object-tree-outline li.parent::before): (.object-tree-outline li.parent.expanded::before): (.object-tree-outline ol): (.object-tree-outline ol.expanded): (.object-tree-outline li .empty-message): (.object-tree-property .name): (.object-tree-property .name.not-enumerable): (.object-tree-property .value.error): (.formatted-object, .formatted-node, .formatted-error, .formatted-map, .formatted-set, .formatted-weakmap): (.formatted-number): (.formatted-string, .formatted-regexp): (.formatted-string): (.formatted-regexp): (.formatted-symbol): (.formatted-null, .formatted-undefined): (.console-group-messages .object-tree:not(.lossless-preview)): (.console-group-messages .object-tree:not(.lossless-preview) > :matches(.title, .object-preview)): (.console-group-messages .object-tree:not(.lossless-preview) > :matches(.title, .object-preview)::before): (.console-group-messages :matches(.console-formatted-object, .console-formatted-node, .console-formatted-error, .console-formatted-map, .console-formatted-set, .console-formatted-weakmap) .object-tree): (.console-group-messages :matches(.console-formatted-object, .console-formatted-node, .console-formatted-error, .console-formatted-map, .console-formatted-set, .console-formatted-weakmap) .object-tree-outline): All styles for ObjectTree / ObjectPreview. Independent from other styles in the inspector. Most of this is a copy of the styles applied to ObjectPropertiesSection, renamed. * UserInterface/Views/ObjectTreeCollectionTreeElement.js: Added. (WebInspector.ObjectTreeCollectionTreeElement): (WebInspector.ObjectTreeCollectionTreeElement.propertyDescriptorForEntry): (WebInspector.ObjectTreeCollectionTreeElement.prototype.get remoteObject): (WebInspector.ObjectTreeCollectionTreeElement.prototype.onexpand.callback): (WebInspector.ObjectTreeCollectionTreeElement.prototype.onexpand): (WebInspector.ObjectTreeCollectionTreeElement.prototype.oncollapse): (WebInspector.ObjectTreeCollectionTreeElement.prototype.ondetach): (WebInspector.ObjectTreeCollectionTreeElement.prototype._trackWeakEntries): (WebInspector.ObjectTreeCollectionTreeElement.prototype._untrackWeakEntries): (WebInspector.ObjectTreeCollectionEntryTreeElement): (WebInspector.ObjectTreeCollectionEntryTreeElement.prototype.onpopulate): (WebInspector.ObjectTreeCollectionEntryTreeElement.prototype.onattach): (WebInspector.ObjectTreeEmptyCollectionTreeElement): Essentially a copy of ObjectPropertiesSection Collection handling using the ObjectTree class names. * UserInterface/Views/TreeOutlineDataGridSynchronizer.js: Fix prototype typo. LayoutTests: * inspector/model/remote-object-expected.txt: * inspector/model/remote-object-get-properties-expected.txt: * inspector/model/remote-object-get-properties.html: * inspector/model/remote-object-weak-collection-expected.txt: * inspector/model/remote-object-weak-collection.html: Update tests and results to use our Model objects and not raw protocol types. Canonical link: https://commits.webkit.org/159826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180356 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-02-19 20:25:04 +00:00
badGetter
Web Inspector: Expanding event objects in console shows undefined for most values, it should have real values https://bugs.webkit.org/show_bug.cgi?id=137306 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-01-20 Reviewed by Timothy Hatcher. Source/JavaScriptCore: Provide another optional parameter to getProperties, to gather a list of all own and getter properties. * inspector/InjectedScript.cpp: (Inspector::InjectedScript::getProperties): * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getProperties): * inspector/agents/InspectorRuntimeAgent.h: * inspector/protocol/Runtime.json: Source/WebInspectorUI: When first expanding an object, show all the object's own properties and any getter properties that may be on its prototype chain. Now, we only fetch own properties, for __proto__ properties. * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.prototype.getOwnProperties): (WebInspector.RemoteObject.prototype.getOwnAndGetterProperties): (WebInspector.RemoteObject.prototype.getAllProperties): (WebInspector.RemoteObject.prototype.get hasChildren): Deleted. * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.ObjectPropertiesSection): (WebInspector.ObjectPropertiesSection.prototype.update): (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate): LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: Added. * inspector/model/remote-object-get-properties.html: Added. Canonical link: https://commits.webkit.org/158679@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178768 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-01-21 00:34:57 +00:00
toString
toLocaleString
valueOf
hasOwnProperty
propertyIsEnumerable
isPrototypeOf
__defineGetter__
__defineSetter__
__lookupGetter__
__lookupSetter__
__proto__
-----------------------------------------------------
-----------------------------------------------------
EXPRESSION: window.unboundFunction
type: function
description: function () { console.log(arguments); }
OWN PROPERTIES:
Partly implement Function.prototype.{caller,arguments} reflection proposal https://bugs.webkit.org/show_bug.cgi?id=158116 Reviewed by Yusuke Suzuki. JSTests: * ChakraCore/test/strict/19.function.baseline: * ChakraCore/test/strict/22.callerCalleeArguments.baseline-jsc: * microbenchmarks/function-prototype-get.js: Added. * microbenchmarks/reflect-own-keys-function.js: Added. * stress/for-in-shadow-non-enumerable.js: * stress/function-hidden-as-caller.js: * stress/has-own-property-arguments.js: * stress/object-assign-fast-path.js: * stress/put-to-proto-chain-overrides-put.js: * stress/reflect-set.js: * test262/config.yaml: Skip 3 test cases that are now incorrect. * test262/expectations.yaml: Mark 2 test cases as passing. Source/JavaScriptCore: To ensure web-compatibility, only the safe subset of Function.prototype.{caller,arguments} reflection proposal [1] is implemented, which is currently shipped in SpiderMonkey. Complete list of differences from the proposed spec: 1. Cross-realm receiver function is allowed instead of throwing a TypeError. Throwing is likely safe to ship, but #225997 needs to be fixed first for custom properties to receive correct global object. 2. Cross-realm caller function is returned instead of `null`. Hiding cross-realm caller may break things: we currently have a test for the opposite behavior. 3. Defines "caller" and "arguments" setters that throw for disallowed receivers, instead failing silently in sloppy mode. This is actually more restrictive than the spec, which is preferable, and aligns with V8 and SM. Most importantly, this patch removes own "caller" and "arguments" properties from sloppy mode ES5 functions. They were non-configurable, making it harder to use their holder as a [[ProxyTarget]]. They were also non-writable, with a constantly changing [[Value]], which violated the invariants of internal methods [2]. As a result, JSFunction methods are greatly simplified, especially defineOwnProperty() and getOwnSpecialPropertyNames(). The latter is now 2.1x faster according to the provided microbenchmark. Also, removes double "prototype" lookup from [[Get]], which is a 10% progression. [1]: https://github.com/claudepache/es-legacy-function-reflection [2]: https://tc39.es/ecma262/#sec-invariants-of-the-essential-internal-methods * runtime/ClonedArguments.cpp: (JSC::ClonedArguments::getOwnPropertySlot): (JSC::ClonedArguments::materializeSpecials): * runtime/FunctionExecutable.h: * runtime/FunctionPrototype.cpp: (JSC::FunctionPrototype::addFunctionProperties): (JSC::isAllowedReceiverFunctionForCallerAndArguments): (JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor): (JSC::RetrieveArgumentsFunctor::result const): (JSC::RetrieveArgumentsFunctor::operator() const): (JSC::retrieveArguments): (JSC::JSC_DEFINE_CUSTOM_GETTER): (JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor): (JSC::RetrieveCallerFunctionFunctor::result const): (JSC::RetrieveCallerFunctionFunctor::operator() const): (JSC::retrieveCallerFunction): (JSC::JSC_DEFINE_CUSTOM_SETTER): (JSC::FunctionPrototype::initRestrictedProperties): Deleted. * runtime/FunctionPrototype.h: * runtime/JSFunction.cpp: (JSC::JSFunction::getOwnPropertySlot): (JSC::JSFunction::getOwnSpecialPropertyNames): (JSC::JSFunction::put): (JSC::JSFunction::deleteProperty): (JSC::JSFunction::defineOwnProperty): (JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor): Deleted. (JSC::RetrieveArgumentsFunctor::result const): Deleted. (JSC::RetrieveArgumentsFunctor::operator() const): Deleted. (JSC::retrieveArguments): Deleted. (JSC::JSC_DEFINE_CUSTOM_GETTER): Deleted. (JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor): Deleted. (JSC::RetrieveCallerFunctionFunctor::result const): Deleted. (JSC::RetrieveCallerFunctionFunctor::operator() const): Deleted. (JSC::retrieveCallerFunction): Deleted. * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): (JSC::JSGlobalObject::visitChildrenImpl): * runtime/JSGlobalObject.h: Remove unused m_throwTypeErrorGetterSetter and make [[ThrowTypeError]] lazily-created. * runtime/JSGlobalObjectFunctions.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * runtime/JSGlobalObjectFunctions.h: * runtime/JSObject.cpp: (JSC::JSObject::putDirectCustomGetterSetterWithoutTransition): * runtime/JSObject.h: LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: * inspector/runtime/getDisplayableProperties-expected.txt: * inspector/runtime/getProperties-expected.txt: * js/Object-getOwnPropertyNames-expected.txt: * js/basic-strict-mode-expected.txt: * js/kde/function_arguments-expected.txt: * js/kde/script-tests/function_arguments.js: * js/non-strict-function-properties-expected.txt: * js/script-tests/Object-getOwnPropertyNames.js: * js/script-tests/basic-strict-mode.js: * js/script-tests/non-strict-function-properties.js: * js/script-tests/throw-type-error-is-unique.js: Canonical link: https://commits.webkit.org/239947@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-25 22:32:20 +00:00
prototype
length
name
__proto__
Web Inspector: Make Getter/Setter RemoteObject property and ObjectPreview handling consistent https://bugs.webkit.org/show_bug.cgi?id=141587 Reviewed by Timothy Hatcher. Source/JavaScriptCore: Convert getProperties(ownAndGetterProperties) to getDisplayableProperties(). Mark PropertyDescriptors that are presumed to be native getters / bindings separately so that the frontend may display them differently. * inspector/InjectedScript.cpp: (Inspector::InjectedScript::getProperties): (Inspector::InjectedScript::getDisplayableProperties): * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getProperties): (Inspector::InspectorRuntimeAgent::getDisplayableProperties): * inspector/agents/InspectorRuntimeAgent.h: * inspector/protocol/Runtime.json: Source/WebInspectorUI: * UserInterface/Models/CallFrame.js: (WebInspector.CallFrame.prototype.collectScopeChainVariableNames): * UserInterface/Models/PropertyDescriptor.js: (WebInspector.PropertyDescriptor.prototype.get nativeGetter): * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.fromPayload): (WebInspector.RemoteObject.prototype.getOwnPropertyDescriptors): (WebInspector.RemoteObject.prototype.getAllPropertyDescriptors): (WebInspector.RemoteObject.prototype.getDisplayablePropertyDescriptors): (WebInspector.RemoteObject.prototype._getPropertyDescriptors): (WebInspector.RemoteObject.prototype.if): (WebInspector.RemoteObject.prototype.deprecatedGetOwnProperties): (WebInspector.RemoteObject.prototype.deprecatedGetAllProperties): (WebInspector.RemoteObject.prototype._deprecatedGetProperties): (WebInspector.RemoteObject.prototype.getOwnAndGetterPropertyDescriptors): Deleted. (WebInspector.RemoteObject.prototype.callback): Deleted. (WebInspector.RemoteObject.prototype.getOwnProperties): Deleted. (WebInspector.RemoteObject.prototype.getOwnAndGetterProperties): Deleted. (WebInspector.RemoteObject.prototype.getAllProperties): Deleted. (WebInspector.RemoteObject.prototype.set else): Deleted. * UserInterface/Views/ConsoleMessageImpl.js: (WebInspector.ConsoleMessageImpl.prototype._formatParameterAsArray): * UserInterface/Views/DOMNodeDetailsSidebarPanel.js: (WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshProperties.nodePrototypesReady): * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.ObjectPropertiesSection.prototype.update): (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate): * UserInterface/Views/ObjectTreePropertyTreeElement.js: (WebInspector.ObjectTreePropertyTreeElement.prototype.): (WebInspector.ObjectTreePropertyTreeElement.prototype): * UserInterface/Views/ObjectTreeView.js: (WebInspector.ObjectTreeView.prototype.update): LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: * inspector/model/remote-object-get-properties.html: Canonical link: https://commits.webkit.org/160009@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180594 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-02-25 00:31:42 +00:00
DISPLAYABLE PROPERTIES:
Partly implement Function.prototype.{caller,arguments} reflection proposal https://bugs.webkit.org/show_bug.cgi?id=158116 Reviewed by Yusuke Suzuki. JSTests: * ChakraCore/test/strict/19.function.baseline: * ChakraCore/test/strict/22.callerCalleeArguments.baseline-jsc: * microbenchmarks/function-prototype-get.js: Added. * microbenchmarks/reflect-own-keys-function.js: Added. * stress/for-in-shadow-non-enumerable.js: * stress/function-hidden-as-caller.js: * stress/has-own-property-arguments.js: * stress/object-assign-fast-path.js: * stress/put-to-proto-chain-overrides-put.js: * stress/reflect-set.js: * test262/config.yaml: Skip 3 test cases that are now incorrect. * test262/expectations.yaml: Mark 2 test cases as passing. Source/JavaScriptCore: To ensure web-compatibility, only the safe subset of Function.prototype.{caller,arguments} reflection proposal [1] is implemented, which is currently shipped in SpiderMonkey. Complete list of differences from the proposed spec: 1. Cross-realm receiver function is allowed instead of throwing a TypeError. Throwing is likely safe to ship, but #225997 needs to be fixed first for custom properties to receive correct global object. 2. Cross-realm caller function is returned instead of `null`. Hiding cross-realm caller may break things: we currently have a test for the opposite behavior. 3. Defines "caller" and "arguments" setters that throw for disallowed receivers, instead failing silently in sloppy mode. This is actually more restrictive than the spec, which is preferable, and aligns with V8 and SM. Most importantly, this patch removes own "caller" and "arguments" properties from sloppy mode ES5 functions. They were non-configurable, making it harder to use their holder as a [[ProxyTarget]]. They were also non-writable, with a constantly changing [[Value]], which violated the invariants of internal methods [2]. As a result, JSFunction methods are greatly simplified, especially defineOwnProperty() and getOwnSpecialPropertyNames(). The latter is now 2.1x faster according to the provided microbenchmark. Also, removes double "prototype" lookup from [[Get]], which is a 10% progression. [1]: https://github.com/claudepache/es-legacy-function-reflection [2]: https://tc39.es/ecma262/#sec-invariants-of-the-essential-internal-methods * runtime/ClonedArguments.cpp: (JSC::ClonedArguments::getOwnPropertySlot): (JSC::ClonedArguments::materializeSpecials): * runtime/FunctionExecutable.h: * runtime/FunctionPrototype.cpp: (JSC::FunctionPrototype::addFunctionProperties): (JSC::isAllowedReceiverFunctionForCallerAndArguments): (JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor): (JSC::RetrieveArgumentsFunctor::result const): (JSC::RetrieveArgumentsFunctor::operator() const): (JSC::retrieveArguments): (JSC::JSC_DEFINE_CUSTOM_GETTER): (JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor): (JSC::RetrieveCallerFunctionFunctor::result const): (JSC::RetrieveCallerFunctionFunctor::operator() const): (JSC::retrieveCallerFunction): (JSC::JSC_DEFINE_CUSTOM_SETTER): (JSC::FunctionPrototype::initRestrictedProperties): Deleted. * runtime/FunctionPrototype.h: * runtime/JSFunction.cpp: (JSC::JSFunction::getOwnPropertySlot): (JSC::JSFunction::getOwnSpecialPropertyNames): (JSC::JSFunction::put): (JSC::JSFunction::deleteProperty): (JSC::JSFunction::defineOwnProperty): (JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor): Deleted. (JSC::RetrieveArgumentsFunctor::result const): Deleted. (JSC::RetrieveArgumentsFunctor::operator() const): Deleted. (JSC::retrieveArguments): Deleted. (JSC::JSC_DEFINE_CUSTOM_GETTER): Deleted. (JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor): Deleted. (JSC::RetrieveCallerFunctionFunctor::result const): Deleted. (JSC::RetrieveCallerFunctionFunctor::operator() const): Deleted. (JSC::retrieveCallerFunction): Deleted. * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): (JSC::JSGlobalObject::visitChildrenImpl): * runtime/JSGlobalObject.h: Remove unused m_throwTypeErrorGetterSetter and make [[ThrowTypeError]] lazily-created. * runtime/JSGlobalObjectFunctions.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * runtime/JSGlobalObjectFunctions.h: * runtime/JSObject.cpp: (JSC::JSObject::putDirectCustomGetterSetterWithoutTransition): * runtime/JSObject.h: LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: * inspector/runtime/getDisplayableProperties-expected.txt: * inspector/runtime/getProperties-expected.txt: * js/Object-getOwnPropertyNames-expected.txt: * js/basic-strict-mode-expected.txt: * js/kde/function_arguments-expected.txt: * js/kde/script-tests/function_arguments.js: * js/non-strict-function-properties-expected.txt: * js/script-tests/Object-getOwnPropertyNames.js: * js/script-tests/basic-strict-mode.js: * js/script-tests/non-strict-function-properties.js: * js/script-tests/throw-type-error-is-unique.js: Canonical link: https://commits.webkit.org/239947@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-25 22:32:20 +00:00
prototype
length
name
Partly implement Function.prototype.{caller,arguments} reflection proposal https://bugs.webkit.org/show_bug.cgi?id=158116 Reviewed by Yusuke Suzuki. JSTests: * ChakraCore/test/strict/19.function.baseline: * ChakraCore/test/strict/22.callerCalleeArguments.baseline-jsc: * microbenchmarks/function-prototype-get.js: Added. * microbenchmarks/reflect-own-keys-function.js: Added. * stress/for-in-shadow-non-enumerable.js: * stress/function-hidden-as-caller.js: * stress/has-own-property-arguments.js: * stress/object-assign-fast-path.js: * stress/put-to-proto-chain-overrides-put.js: * stress/reflect-set.js: * test262/config.yaml: Skip 3 test cases that are now incorrect. * test262/expectations.yaml: Mark 2 test cases as passing. Source/JavaScriptCore: To ensure web-compatibility, only the safe subset of Function.prototype.{caller,arguments} reflection proposal [1] is implemented, which is currently shipped in SpiderMonkey. Complete list of differences from the proposed spec: 1. Cross-realm receiver function is allowed instead of throwing a TypeError. Throwing is likely safe to ship, but #225997 needs to be fixed first for custom properties to receive correct global object. 2. Cross-realm caller function is returned instead of `null`. Hiding cross-realm caller may break things: we currently have a test for the opposite behavior. 3. Defines "caller" and "arguments" setters that throw for disallowed receivers, instead failing silently in sloppy mode. This is actually more restrictive than the spec, which is preferable, and aligns with V8 and SM. Most importantly, this patch removes own "caller" and "arguments" properties from sloppy mode ES5 functions. They were non-configurable, making it harder to use their holder as a [[ProxyTarget]]. They were also non-writable, with a constantly changing [[Value]], which violated the invariants of internal methods [2]. As a result, JSFunction methods are greatly simplified, especially defineOwnProperty() and getOwnSpecialPropertyNames(). The latter is now 2.1x faster according to the provided microbenchmark. Also, removes double "prototype" lookup from [[Get]], which is a 10% progression. [1]: https://github.com/claudepache/es-legacy-function-reflection [2]: https://tc39.es/ecma262/#sec-invariants-of-the-essential-internal-methods * runtime/ClonedArguments.cpp: (JSC::ClonedArguments::getOwnPropertySlot): (JSC::ClonedArguments::materializeSpecials): * runtime/FunctionExecutable.h: * runtime/FunctionPrototype.cpp: (JSC::FunctionPrototype::addFunctionProperties): (JSC::isAllowedReceiverFunctionForCallerAndArguments): (JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor): (JSC::RetrieveArgumentsFunctor::result const): (JSC::RetrieveArgumentsFunctor::operator() const): (JSC::retrieveArguments): (JSC::JSC_DEFINE_CUSTOM_GETTER): (JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor): (JSC::RetrieveCallerFunctionFunctor::result const): (JSC::RetrieveCallerFunctionFunctor::operator() const): (JSC::retrieveCallerFunction): (JSC::JSC_DEFINE_CUSTOM_SETTER): (JSC::FunctionPrototype::initRestrictedProperties): Deleted. * runtime/FunctionPrototype.h: * runtime/JSFunction.cpp: (JSC::JSFunction::getOwnPropertySlot): (JSC::JSFunction::getOwnSpecialPropertyNames): (JSC::JSFunction::put): (JSC::JSFunction::deleteProperty): (JSC::JSFunction::defineOwnProperty): (JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor): Deleted. (JSC::RetrieveArgumentsFunctor::result const): Deleted. (JSC::RetrieveArgumentsFunctor::operator() const): Deleted. (JSC::retrieveArguments): Deleted. (JSC::JSC_DEFINE_CUSTOM_GETTER): Deleted. (JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor): Deleted. (JSC::RetrieveCallerFunctionFunctor::result const): Deleted. (JSC::RetrieveCallerFunctionFunctor::operator() const): Deleted. (JSC::retrieveCallerFunction): Deleted. * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): (JSC::JSGlobalObject::visitChildrenImpl): * runtime/JSGlobalObject.h: Remove unused m_throwTypeErrorGetterSetter and make [[ThrowTypeError]] lazily-created. * runtime/JSGlobalObjectFunctions.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * runtime/JSGlobalObjectFunctions.h: * runtime/JSObject.cpp: (JSC::JSObject::putDirectCustomGetterSetterWithoutTransition): * runtime/JSObject.h: LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: * inspector/runtime/getDisplayableProperties-expected.txt: * inspector/runtime/getProperties-expected.txt: * js/Object-getOwnPropertyNames-expected.txt: * js/basic-strict-mode-expected.txt: * js/kde/function_arguments-expected.txt: * js/kde/script-tests/function_arguments.js: * js/non-strict-function-properties-expected.txt: * js/script-tests/Object-getOwnPropertyNames.js: * js/script-tests/basic-strict-mode.js: * js/script-tests/non-strict-function-properties.js: * js/script-tests/throw-type-error-is-unique.js: Canonical link: https://commits.webkit.org/239947@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-25 22:32:20 +00:00
arguments
caller
__proto__
ALL PROPERTIES:
Partly implement Function.prototype.{caller,arguments} reflection proposal https://bugs.webkit.org/show_bug.cgi?id=158116 Reviewed by Yusuke Suzuki. JSTests: * ChakraCore/test/strict/19.function.baseline: * ChakraCore/test/strict/22.callerCalleeArguments.baseline-jsc: * microbenchmarks/function-prototype-get.js: Added. * microbenchmarks/reflect-own-keys-function.js: Added. * stress/for-in-shadow-non-enumerable.js: * stress/function-hidden-as-caller.js: * stress/has-own-property-arguments.js: * stress/object-assign-fast-path.js: * stress/put-to-proto-chain-overrides-put.js: * stress/reflect-set.js: * test262/config.yaml: Skip 3 test cases that are now incorrect. * test262/expectations.yaml: Mark 2 test cases as passing. Source/JavaScriptCore: To ensure web-compatibility, only the safe subset of Function.prototype.{caller,arguments} reflection proposal [1] is implemented, which is currently shipped in SpiderMonkey. Complete list of differences from the proposed spec: 1. Cross-realm receiver function is allowed instead of throwing a TypeError. Throwing is likely safe to ship, but #225997 needs to be fixed first for custom properties to receive correct global object. 2. Cross-realm caller function is returned instead of `null`. Hiding cross-realm caller may break things: we currently have a test for the opposite behavior. 3. Defines "caller" and "arguments" setters that throw for disallowed receivers, instead failing silently in sloppy mode. This is actually more restrictive than the spec, which is preferable, and aligns with V8 and SM. Most importantly, this patch removes own "caller" and "arguments" properties from sloppy mode ES5 functions. They were non-configurable, making it harder to use their holder as a [[ProxyTarget]]. They were also non-writable, with a constantly changing [[Value]], which violated the invariants of internal methods [2]. As a result, JSFunction methods are greatly simplified, especially defineOwnProperty() and getOwnSpecialPropertyNames(). The latter is now 2.1x faster according to the provided microbenchmark. Also, removes double "prototype" lookup from [[Get]], which is a 10% progression. [1]: https://github.com/claudepache/es-legacy-function-reflection [2]: https://tc39.es/ecma262/#sec-invariants-of-the-essential-internal-methods * runtime/ClonedArguments.cpp: (JSC::ClonedArguments::getOwnPropertySlot): (JSC::ClonedArguments::materializeSpecials): * runtime/FunctionExecutable.h: * runtime/FunctionPrototype.cpp: (JSC::FunctionPrototype::addFunctionProperties): (JSC::isAllowedReceiverFunctionForCallerAndArguments): (JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor): (JSC::RetrieveArgumentsFunctor::result const): (JSC::RetrieveArgumentsFunctor::operator() const): (JSC::retrieveArguments): (JSC::JSC_DEFINE_CUSTOM_GETTER): (JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor): (JSC::RetrieveCallerFunctionFunctor::result const): (JSC::RetrieveCallerFunctionFunctor::operator() const): (JSC::retrieveCallerFunction): (JSC::JSC_DEFINE_CUSTOM_SETTER): (JSC::FunctionPrototype::initRestrictedProperties): Deleted. * runtime/FunctionPrototype.h: * runtime/JSFunction.cpp: (JSC::JSFunction::getOwnPropertySlot): (JSC::JSFunction::getOwnSpecialPropertyNames): (JSC::JSFunction::put): (JSC::JSFunction::deleteProperty): (JSC::JSFunction::defineOwnProperty): (JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor): Deleted. (JSC::RetrieveArgumentsFunctor::result const): Deleted. (JSC::RetrieveArgumentsFunctor::operator() const): Deleted. (JSC::retrieveArguments): Deleted. (JSC::JSC_DEFINE_CUSTOM_GETTER): Deleted. (JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor): Deleted. (JSC::RetrieveCallerFunctionFunctor::result const): Deleted. (JSC::RetrieveCallerFunctionFunctor::operator() const): Deleted. (JSC::retrieveCallerFunction): Deleted. * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): (JSC::JSGlobalObject::visitChildrenImpl): * runtime/JSGlobalObject.h: Remove unused m_throwTypeErrorGetterSetter and make [[ThrowTypeError]] lazily-created. * runtime/JSGlobalObjectFunctions.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * runtime/JSGlobalObjectFunctions.h: * runtime/JSObject.cpp: (JSC::JSObject::putDirectCustomGetterSetterWithoutTransition): * runtime/JSObject.h: LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: * inspector/runtime/getDisplayableProperties-expected.txt: * inspector/runtime/getProperties-expected.txt: * js/Object-getOwnPropertyNames-expected.txt: * js/basic-strict-mode-expected.txt: * js/kde/function_arguments-expected.txt: * js/kde/script-tests/function_arguments.js: * js/non-strict-function-properties-expected.txt: * js/script-tests/Object-getOwnPropertyNames.js: * js/script-tests/basic-strict-mode.js: * js/script-tests/non-strict-function-properties.js: * js/script-tests/throw-type-error-is-unique.js: Canonical link: https://commits.webkit.org/239947@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-25 22:32:20 +00:00
prototype
length
name
toString
apply
call
bind
Partly implement Function.prototype.{caller,arguments} reflection proposal https://bugs.webkit.org/show_bug.cgi?id=158116 Reviewed by Yusuke Suzuki. JSTests: * ChakraCore/test/strict/19.function.baseline: * ChakraCore/test/strict/22.callerCalleeArguments.baseline-jsc: * microbenchmarks/function-prototype-get.js: Added. * microbenchmarks/reflect-own-keys-function.js: Added. * stress/for-in-shadow-non-enumerable.js: * stress/function-hidden-as-caller.js: * stress/has-own-property-arguments.js: * stress/object-assign-fast-path.js: * stress/put-to-proto-chain-overrides-put.js: * stress/reflect-set.js: * test262/config.yaml: Skip 3 test cases that are now incorrect. * test262/expectations.yaml: Mark 2 test cases as passing. Source/JavaScriptCore: To ensure web-compatibility, only the safe subset of Function.prototype.{caller,arguments} reflection proposal [1] is implemented, which is currently shipped in SpiderMonkey. Complete list of differences from the proposed spec: 1. Cross-realm receiver function is allowed instead of throwing a TypeError. Throwing is likely safe to ship, but #225997 needs to be fixed first for custom properties to receive correct global object. 2. Cross-realm caller function is returned instead of `null`. Hiding cross-realm caller may break things: we currently have a test for the opposite behavior. 3. Defines "caller" and "arguments" setters that throw for disallowed receivers, instead failing silently in sloppy mode. This is actually more restrictive than the spec, which is preferable, and aligns with V8 and SM. Most importantly, this patch removes own "caller" and "arguments" properties from sloppy mode ES5 functions. They were non-configurable, making it harder to use their holder as a [[ProxyTarget]]. They were also non-writable, with a constantly changing [[Value]], which violated the invariants of internal methods [2]. As a result, JSFunction methods are greatly simplified, especially defineOwnProperty() and getOwnSpecialPropertyNames(). The latter is now 2.1x faster according to the provided microbenchmark. Also, removes double "prototype" lookup from [[Get]], which is a 10% progression. [1]: https://github.com/claudepache/es-legacy-function-reflection [2]: https://tc39.es/ecma262/#sec-invariants-of-the-essential-internal-methods * runtime/ClonedArguments.cpp: (JSC::ClonedArguments::getOwnPropertySlot): (JSC::ClonedArguments::materializeSpecials): * runtime/FunctionExecutable.h: * runtime/FunctionPrototype.cpp: (JSC::FunctionPrototype::addFunctionProperties): (JSC::isAllowedReceiverFunctionForCallerAndArguments): (JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor): (JSC::RetrieveArgumentsFunctor::result const): (JSC::RetrieveArgumentsFunctor::operator() const): (JSC::retrieveArguments): (JSC::JSC_DEFINE_CUSTOM_GETTER): (JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor): (JSC::RetrieveCallerFunctionFunctor::result const): (JSC::RetrieveCallerFunctionFunctor::operator() const): (JSC::retrieveCallerFunction): (JSC::JSC_DEFINE_CUSTOM_SETTER): (JSC::FunctionPrototype::initRestrictedProperties): Deleted. * runtime/FunctionPrototype.h: * runtime/JSFunction.cpp: (JSC::JSFunction::getOwnPropertySlot): (JSC::JSFunction::getOwnSpecialPropertyNames): (JSC::JSFunction::put): (JSC::JSFunction::deleteProperty): (JSC::JSFunction::defineOwnProperty): (JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor): Deleted. (JSC::RetrieveArgumentsFunctor::result const): Deleted. (JSC::RetrieveArgumentsFunctor::operator() const): Deleted. (JSC::retrieveArguments): Deleted. (JSC::JSC_DEFINE_CUSTOM_GETTER): Deleted. (JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor): Deleted. (JSC::RetrieveCallerFunctionFunctor::result const): Deleted. (JSC::RetrieveCallerFunctionFunctor::operator() const): Deleted. (JSC::retrieveCallerFunction): Deleted. * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): (JSC::JSGlobalObject::visitChildrenImpl): * runtime/JSGlobalObject.h: Remove unused m_throwTypeErrorGetterSetter and make [[ThrowTypeError]] lazily-created. * runtime/JSGlobalObjectFunctions.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * runtime/JSGlobalObjectFunctions.h: * runtime/JSObject.cpp: (JSC::JSObject::putDirectCustomGetterSetterWithoutTransition): * runtime/JSObject.h: LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: * inspector/runtime/getDisplayableProperties-expected.txt: * inspector/runtime/getProperties-expected.txt: * js/Object-getOwnPropertyNames-expected.txt: * js/basic-strict-mode-expected.txt: * js/kde/function_arguments-expected.txt: * js/kde/script-tests/function_arguments.js: * js/non-strict-function-properties-expected.txt: * js/script-tests/Object-getOwnPropertyNames.js: * js/script-tests/basic-strict-mode.js: * js/script-tests/non-strict-function-properties.js: * js/script-tests/throw-type-error-is-unique.js: Canonical link: https://commits.webkit.org/239947@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-25 22:32:20 +00:00
arguments
caller
constructor
[ES6] Add support for Symbol.hasInstance https://bugs.webkit.org/show_bug.cgi?id=151839 Reviewed by Saam Barati. Source/JavaScriptCore: Fixed version of r193986, r193983, and r193974. This patch adds support for Symbol.hasInstance, unfortunately in order to prevent regressions several new bytecodes and DFG IR nodes were necessary. Before, Symbol.hasInstance when executing an instanceof expression we would emit three bytecodes: overrides_has_instance, get_by_id, then instanceof. As the spec has changed, we emit a more complicated set of bytecodes in addition to some new ones. First the role of overrides_has_instance and its corresponding DFG node have changed. Now it returns a js-boolean indicating whether the RHS of the instanceof expression (from here on called the constructor for simplicity) needs non-default behavior for resolving the expression. i.e. The constructor has a Symbol.hasInstance that differs from the one on Function.prototype[Symbol.hasInstance] or is a bound/C-API function. Once we get to the DFG this node is generally eliminated as we can prove the value of Symbol.hasInstance is a constant. The second new bytecode is instanceof_custom. insntanceof_custom, just emits a call to slow path code that computes the result. In the DFG, there is also a new node, CheckTypeInfoFlags, which checks the type info flags are consistent with the ones provided and OSR exits if the flags are not. Additionally, we attempt to prove that the result of CheckHasValue will be a constant and transform it into a CheckTypeInfoFlags followed by a JSConstant. * API/JSCallbackObject.h: * builtins/FunctionPrototype.js: (symbolHasInstance): * bytecode/BytecodeBasicBlock.cpp: (JSC::isBranch): Deleted. * bytecode/BytecodeList.json: * bytecode/BytecodeUseDef.h: (JSC::computeUsesForBytecodeOffset): (JSC::computeDefsForBytecodeOffset): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dumpBytecode): * bytecode/ExitKind.cpp: (JSC::exitKindToString): * bytecode/ExitKind.h: * bytecode/PreciseJumpTargets.cpp: (JSC::getJumpTargetsForBytecodeOffset): Deleted. * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitOverridesHasInstance): (JSC::BytecodeGenerator::emitInstanceOfCustom): (JSC::BytecodeGenerator::emitCheckHasInstance): Deleted. * bytecompiler/BytecodeGenerator.h: * bytecompiler/NodesCodegen.cpp: (JSC::InstanceOfNode::emitBytecode): * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::parseBlock): * dfg/DFGCapabilities.cpp: (JSC::DFG::capabilityLevel): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): * dfg/DFGDoesGC.cpp: (JSC::DFG::doesGC): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGHeapLocation.cpp: (WTF::printInternal): * dfg/DFGHeapLocation.h: * dfg/DFGNode.h: (JSC::DFG::Node::hasCellOperand): (JSC::DFG::Node::hasTypeInfoOperand): (JSC::DFG::Node::typeInfoOperand): * dfg/DFGNodeType.h: * dfg/DFGPredictionPropagationPhase.cpp: (JSC::DFG::PredictionPropagationPhase::propagate): * dfg/DFGSafeToExecute.h: (JSC::DFG::safeToExecute): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileCheckTypeInfoFlags): (JSC::DFG::SpeculativeJIT::compileInstanceOfCustom): * dfg/DFGSpeculativeJIT.h: (JSC::DFG::SpeculativeJIT::callOperation): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLIntrinsicRepository.h: * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::DFG::LowerDFGToLLVM::compileNode): (JSC::FTL::DFG::LowerDFGToLLVM::compileOverridesHasInstance): (JSC::FTL::DFG::LowerDFGToLLVM::compileCheckTypeInfoFlags): (JSC::FTL::DFG::LowerDFGToLLVM::compileInstanceOfCustom): (JSC::FTL::DFG::LowerDFGToLLVM::compileCheckHasInstance): Deleted. * jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases): * jit/JIT.h: * jit/JITInlines.h: (JSC::JIT::callOperation): * jit/JITOpcodes.cpp: (JSC::JIT::emit_op_overrides_has_instance): (JSC::JIT::emit_op_instanceof): (JSC::JIT::emit_op_instanceof_custom): (JSC::JIT::emitSlow_op_instanceof): (JSC::JIT::emitSlow_op_instanceof_custom): (JSC::JIT::emit_op_check_has_instance): Deleted. (JSC::JIT::emitSlow_op_check_has_instance): Deleted. * jit/JITOpcodes32_64.cpp: (JSC::JIT::emit_op_overrides_has_instance): (JSC::JIT::emit_op_instanceof): (JSC::JIT::emit_op_instanceof_custom): (JSC::JIT::emitSlow_op_instanceof_custom): (JSC::JIT::emit_op_check_has_instance): Deleted. (JSC::JIT::emitSlow_op_check_has_instance): Deleted. * jit/JITOperations.cpp: * jit/JITOperations.h: * llint/LLIntData.cpp: (JSC::LLInt::Data::performAssertions): * llint/LLIntSlowPaths.cpp: (JSC::LLInt::LLINT_SLOW_PATH_DECL): * llint/LLIntSlowPaths.h: * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: * runtime/CommonIdentifiers.h: * runtime/ExceptionHelpers.cpp: (JSC::invalidParameterInstanceofSourceAppender): (JSC::invalidParameterInstanceofNotFunctionSourceAppender): (JSC::invalidParameterInstanceofhasInstanceValueNotFunctionSourceAppender): (JSC::createInvalidInstanceofParameterErrorNotFunction): (JSC::createInvalidInstanceofParameterErrorhasInstanceValueNotFunction): (JSC::createInvalidInstanceofParameterError): Deleted. * runtime/ExceptionHelpers.h: * runtime/FunctionPrototype.cpp: (JSC::FunctionPrototype::addFunctionProperties): * runtime/FunctionPrototype.h: * runtime/JSBoundFunction.cpp: (JSC::isBoundFunction): (JSC::hasInstanceBoundFunction): * runtime/JSBoundFunction.h: * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): (JSC::JSGlobalObject::visitChildren): * runtime/JSGlobalObject.h: (JSC::JSGlobalObject::functionProtoHasInstanceSymbolFunction): * runtime/JSObject.cpp: (JSC::JSObject::hasInstance): (JSC::objectPrivateFuncInstanceOf): * runtime/JSObject.h: * runtime/JSTypeInfo.h: (JSC::TypeInfo::TypeInfo): (JSC::TypeInfo::overridesHasInstance): * runtime/WriteBarrier.h: (JSC::WriteBarrierBase<Unknown>::slot): * tests/es6.yaml: * tests/stress/instanceof-custom-hasinstancesymbol.js: Added. (Constructor): (value): (instanceOf): (body): * tests/stress/symbol-hasInstance.js: Added. (Constructor): (value): (ObjectClass.Symbol.hasInstance): (NumberClass.Symbol.hasInstance): LayoutTests: Fix tests to reflect the changes to instanceof in ES6. Added a new regression test for bound functions in instanceof as the perfomance on bound functions should, to some degree, reflect the performance on C-API users. * inspector/model/remote-object-get-properties-expected.txt: * js/Object-getOwnPropertyNames-expected.txt: * js/exception-for-nonobject-expected.txt: * js/exception-instanceof-expected.txt: * js/instance-of-immediates-expected.txt: * js/regress/instanceof-bound-expected.txt: Added. * js/regress/instanceof-bound.html: Added. * js/regress/script-tests/instanceof-bound.js: Added. (Constructor): (test): * js/script-tests/Object-getOwnPropertyNames.js: Canonical link: https://commits.webkit.org/170515@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194248 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-18 00:37:35 +00:00
Symbol(Symbol.hasInstance)
toLocaleString
valueOf
hasOwnProperty
propertyIsEnumerable
isPrototypeOf
__defineGetter__
__defineSetter__
__lookupGetter__
__lookupSetter__
__proto__
-----------------------------------------------------
-----------------------------------------------------
EXPRESSION: window.boundFunction
type: function
Implement Function.name support for getters/setters and inferring name of function properties. https://bugs.webkit.org/show_bug.cgi?id=154865 Reviewed by Geoffrey Garen. Source/JavaScriptCore: 1. toString() no longer uses the value of Function.name as the name of the function in the returned string, because ... i. Function.name is supposed to be configurable. Hence, it can be made writable and can be set to any JSValue, or deleted. ii. Function.prototype.toString() is supposed to produce a string that can be eval'ed. Hence, for JS functions, the function name in the produced string must be a legal function name (and not some arbitrary value set in Function.name). For example, while a number is a legal value for Function.name, it is not legal as the function name in the toString() string. Instead, we'll always use the original name from the JS source that the function was parsed from. 2. JSFunction::name() now always return the original name, not the value of the Function.name property. As a result, it also no longer needs an ExecState* arg. If the original name is an empty string, JSFunction::name() will use the inferred name. 3. For JS functions, the original name can be attained from their FunctionExecutable object. For host/native functions (which do not have a FunctionExecutable), we get the "original" name from its NativeExecutable. 4. The m_hostFunctionStubMap now keys its NativeExecutable pointers using the original name, in addition to the native function and constructor pointers. This is needed because we want a different NativeExecutable for functions with a different name (to satisfy (3) above). 5. Changed JSBoundFunction to store the name of its bound function in its NativeExecutable. This will later be used to generate the toString() string. It's Function.name value is eagerly initialized at construction time. 6. Function.name for getters/setters are now prefixed with "get"/"set". This was done both for the JSBoundSlotBaseFunctions and JS definable get/set functions. 7. Added InternalFunction::m_originalName so that we can use it to generate the toString() string. We're storing it as a JSString instead of a WTF::String only because we want InternalFunction to be continue to be trivially destructible. * inspector/JSInjectedScriptHost.cpp: (Inspector::JSInjectedScriptHost::functionDetails): * jit/JITThunks.cpp: (JSC::JITThunks::finalize): (JSC::JITThunks::hostFunctionStub): * jit/JITThunks.h: * runtime/Executable.h: * runtime/FunctionPrototype.cpp: (JSC::functionProtoFuncToString): * runtime/InternalFunction.cpp: (JSC::InternalFunction::finishCreation): (JSC::InternalFunction::visitChildren): (JSC::InternalFunction::name): (JSC::InternalFunction::displayName): * runtime/InternalFunction.h: * runtime/JSBoundFunction.cpp: (JSC::JSBoundFunction::create): (JSC::JSBoundFunction::visitChildren): (JSC::JSBoundFunction::toStringName): Deleted. * runtime/JSBoundFunction.h: (JSC::JSBoundFunction::boundThis): (JSC::JSBoundFunction::boundArgs): (JSC::JSBoundFunction::createStructure): * runtime/JSBoundSlotBaseFunction.cpp: (JSC::boundSlotBaseFunctionCall): (JSC::JSBoundSlotBaseFunction::create): * runtime/JSFunction.cpp: (JSC::JSFunction::initializeRareData): (JSC::JSFunction::name): (JSC::JSFunction::displayName): (JSC::JSFunction::calculatedDisplayName): (JSC::JSFunction::reifyName): * runtime/JSFunction.h: * tests/es6.yaml: LayoutTests: * js/function-toString-vs-name-expected.txt: Added. * js/function-toString-vs-name.html: Added. * js/script-tests/function-toString-vs-name.js: Added. Canonical link: https://commits.webkit.org/173305@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197815 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-09 00:01:09 +00:00
description: function unboundFunction() {
[native code]
}
OWN PROPERTIES:
length
[JSC] Improve our bound function implementation https://bugs.webkit.org/show_bug.cgi?id=205327 Reviewed by Keith Miller. JSTests: * microbenchmarks/function-bind-no-inlining-repeat-call.js: Added. (assert): (test): (test2): (foo): (let.start.Date.now): * stress/bind-args.js: Added. (shouldBe): (test): (test2): Source/JavaScriptCore: This patch improves Function#bind, and calling bound function with bound arguments. 1. Rename CallFrameSlot::argumentCount to CallFrameSlot::argumentCountIncludingThis. 2. Do not include name in NativeExecutable for JSBoundFunction. Putting name in NativeExecutable is assuming that function + name pair is almost identical. This is true in host functions except for JSBoundFunction. JSBoundFunction should hold its name in JSBoundFunction. 3. Cache NativeExecutable for JSBoundFunction in the VM. We use a hash-map in JITThunk for NativeExecutables because we assume that host-function creation cannot be done by the user program: each executable is pre-defined to exactly one object by the environment, and there is no way to create host-functions repeatedly from the user-program. The only exception to this is JSBoundFunction so caching it on the VM avoids the hash-map lookup. This is not true for JSBoundFunction. 4. ThunkGenerator should support JSBoundFunction call with bound arguments. It turns out that Speedometer2/React-Redux-TodoMVC is using bound function with bound arguments. Additionally, it is used. This is really bad: when dispatching an event, we first call this function from C++, entering JS world, going back to C++ world again, and entering JS world to call bound function again. By using ThunkGenerator, we can eliminate this back and forth by directly calling the bound JS Executable from the thunk. Previously, bound arguments are stored in JSArray. But it is difficult to access them from thunk since we need to consider have-a-bad-time case. Instead, we use JSImmutableButterfly to save bound arguments so that JIT thunk can quickly access arguments. To capture arguments as JSImmutableButterfly in JS world, we introduce op_create_arguments_butterfly, and handle it in all tiers. 5. It turns out that eager materialization of "length" in JSBoundFunction takes long time while it is rarely used. This patch makes length lazily reified for JSBoundFunction. 6. To make Function.prototype.bind faster, we track whether "name" and "length" properties of JSFunction is modified or not. This skips has-own-length-property check, which makes Function.prototype.bind 11~% faster. Combining things above, creation of JSBoundFunction is 80~% faster. And calling bound function with bound arguments is 3~x faster. This improves Speedometer2/React-TodoMVC by ~3%. * builtins/FunctionPrototype.js: (bind): * bytecode/AccessCase.cpp: (JSC::AccessCase::generateImpl): * bytecode/AccessCaseSnippetParams.cpp: (JSC::SlowPathCallGeneratorWithArguments::generateImpl): * bytecode/BytecodeIntrinsicRegistry.h: * bytecode/BytecodeList.rb: * bytecode/BytecodeUseDef.cpp: (JSC::computeUsesForBytecodeIndexImpl): (JSC::computeDefsForBytecodeIndexImpl): * bytecode/VirtualRegister.cpp: (JSC::VirtualRegister::dump const): * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitCreateArgumentsButterfly): * bytecompiler/BytecodeGenerator.h: * bytecompiler/NodesCodegen.cpp: (JSC::BytecodeIntrinsicNode::emit_intrinsic_createArgumentsButterfly): * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): * dfg/DFGArgumentsEliminationPhase.cpp: * dfg/DFGArgumentsUtilities.cpp: (JSC::DFG::argumentsInvolveStackSlot): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::flushImpl): (JSC::DFG::ByteCodeParser::handleVarargsInlining): (JSC::DFG::ByteCodeParser::parseBlock): * dfg/DFGCapabilities.cpp: (JSC::DFG::capabilityLevel): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): * dfg/DFGDoesGC.cpp: (JSC::DFG::doesGC): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::isLiveInBytecode): * dfg/DFGGraph.h: (JSC::DFG::Graph::forAllLocalsLiveInBytecode): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::emitStoreCallSiteIndex): * dfg/DFGNodeType.h: * dfg/DFGOSRAvailabilityAnalysisPhase.cpp: (JSC::DFG::LocalOSRAvailabilityCalculator::executeNode): * dfg/DFGOSRExit.cpp: (JSC::DFG::emitRestoreArguments): (JSC::DFG::reifyInlinedCallFrames): (JSC::DFG::OSRExit::emitRestoreArguments): * dfg/DFGOSRExitCompilerCommon.cpp: (JSC::DFG::reifyInlinedCallFrames): * dfg/DFGOperations.cpp: * dfg/DFGOperations.h: * dfg/DFGPreciseLocalClobberize.h: (JSC::DFG::PreciseLocalClobberizeAdaptor::readTop): * dfg/DFGPredictionPropagationPhase.cpp: * dfg/DFGSafeToExecute.h: (JSC::DFG::safeToExecute): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileCreateArgumentsButterfly): (JSC::DFG::SpeculativeJIT::compileGetArgumentCountIncludingThis): (JSC::DFG::SpeculativeJIT::compileSetArgumentCountIncludingThis): * dfg/DFGSpeculativeJIT.h: * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::emitCall): (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::emitCall): (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGStackLayoutPhase.cpp: (JSC::DFG::StackLayoutPhase::run): * dfg/DFGStoreBarrierInsertionPhase.cpp: * ftl/FTLAbstractHeapRepository.h: * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLLink.cpp: (JSC::FTL::link): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::lower): (JSC::FTL::DFG::LowerDFGToB3::compileNode): (JSC::FTL::DFG::LowerDFGToB3::compileCreateArgumentsButterfly): (JSC::FTL::DFG::LowerDFGToB3::compileGetArgumentCountIncludingThis): (JSC::FTL::DFG::LowerDFGToB3::compileSetArgumentCountIncludingThis): (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct): (JSC::FTL::DFG::LowerDFGToB3::compileDirectCallOrConstruct): (JSC::FTL::DFG::LowerDFGToB3::compileTailCall): (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread): (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs): (JSC::FTL::DFG::LowerDFGToB3::compileCallEval): (JSC::FTL::DFG::LowerDFGToB3::getArgumentsLength): (JSC::FTL::DFG::LowerDFGToB3::callPreflight): * ftl/FTLSlowPathCall.h: (JSC::FTL::callOperation): * interpreter/CallFrame.cpp: (JSC::CallFrame::callSiteAsRawBits const): (JSC::CallFrame::unsafeCallSiteAsRawBits const): (JSC::CallFrame::setCurrentVPC): * interpreter/CallFrame.h: (JSC::CallFrame::argumentCountIncludingThis const): (JSC::CallFrame::setArgumentCountIncludingThis): * jit/AssemblyHelpers.cpp: (JSC::AssemblyHelpers::jitAssertArgumentCountSane): * jit/AssemblyHelpers.h: (JSC::AssemblyHelpers::argumentCount): * jit/CCallHelpers.h: (JSC::CCallHelpers::prepareForTailCallSlow): * jit/CallFrameShuffler.cpp: (JSC::CallFrameShuffler::dump const): (JSC::CallFrameShuffler::prepareForTailCall): (JSC::CallFrameShuffler::prepareAny): * jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::compileWithoutLinking): * jit/JITCall.cpp: (JSC::JIT::compileSetupFrame): (JSC::JIT::compileOpCall): * jit/JITCall32_64.cpp: (JSC::JIT::compileSetupFrame): (JSC::JIT::compileOpCall): * jit/JITInlines.h: (JSC::JIT::updateTopCallFrame): * jit/JITOpcodes.cpp: (JSC::JIT::emit_op_argument_count): (JSC::JIT::emit_op_get_rest_length): (JSC::JIT::emit_op_get_argument): * jit/SetupVarargsFrame.cpp: (JSC::emitSetupVarargsFrameFastCase): * jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::SpecializedThunkJIT): * jit/ThunkGenerators.cpp: (JSC::arityFixupGenerator): (JSC::boundFunctionCallGenerator): (JSC::boundThisNoArgsFunctionCallGenerator): Deleted. * jit/ThunkGenerators.h: * jsc.cpp: * llint/LLIntData.cpp: (JSC::LLInt::Data::performAssertions): * llint/LowLevelInterpreter.asm: * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: * llint/WebAssembly.asm: * runtime/CommonSlowPaths.cpp: (JSC::SLOW_PATH_DECL): * runtime/CommonSlowPaths.h: * runtime/ExecutableBase.h: * runtime/FunctionRareData.cpp: (JSC::FunctionRareData::FunctionRareData): * runtime/FunctionRareData.h: * runtime/IntlCollatorPrototype.cpp: (JSC::IntlCollatorPrototypeGetterCompare): * runtime/IntlDateTimeFormatPrototype.cpp: (JSC::IntlDateTimeFormatPrototypeGetterFormat): * runtime/IntlNumberFormatPrototype.cpp: (JSC::IntlNumberFormatPrototypeGetterFormat): * runtime/Intrinsic.cpp: (JSC::intrinsicName): * runtime/Intrinsic.h: * runtime/JSBoundFunction.cpp: (JSC::boundThisNoArgsFunctionCall): (JSC::boundFunctionCall): (JSC::boundThisNoArgsFunctionConstruct): (JSC::boundFunctionConstruct): (JSC::JSBoundFunction::create): (JSC::JSBoundFunction::JSBoundFunction): (JSC::JSBoundFunction::boundArgsCopy): (JSC::JSBoundFunction::visitChildren): * runtime/JSBoundFunction.h: * runtime/JSFunction.cpp: (JSC::JSFunction::finishCreation): (JSC::JSFunction::name): (JSC::JSFunction::getOwnPropertySlot): (JSC::JSFunction::getOwnNonIndexPropertyNames): (JSC::JSFunction::put): (JSC::JSFunction::deleteProperty): (JSC::JSFunction::defineOwnProperty): (JSC::JSFunction::reifyLength): (JSC::JSFunction::reifyLazyPropertyIfNeeded): (JSC::JSFunction::reifyLazyPropertyForHostOrBuiltinIfNeeded): (JSC::JSFunction::reifyLazyBoundNameIfNeeded): * runtime/JSFunction.h: * runtime/JSFunctionInlines.h: (JSC::JSFunction::areNameAndLengthOriginal): * runtime/JSGlobalObject.cpp: (JSC::makeBoundFunction): (JSC::hasOwnLengthProperty): * runtime/JSObject.h: (JSC::getJSFunction): (JSC::getCallData): Deleted. (JSC::getConstructData): Deleted. * runtime/JSObjectInlines.h: (JSC::getCallData): (JSC::getConstructData): * runtime/VM.cpp: (JSC::thunkGeneratorForIntrinsic): (JSC::VM::getBoundFunction): * runtime/VM.h: * wasm/js/WasmToJS.cpp: (JSC::Wasm::wasmToJS): * wasm/js/WebAssemblyFunction.cpp: (JSC::WebAssemblyFunction::jsCallEntrypointSlow): Tools: Support running slow-microbenchmarks. * Scripts/run-jsc-benchmarks: LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: * inspector/runtime/getDisplayableProperties-expected.txt: * inspector/runtime/getProperties-expected.txt: Canonical link: https://commits.webkit.org/218747@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253867 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-12-22 03:12:00 +00:00
name
__proto__
targetFunction
boundThis
boundArgs
Web Inspector: Make Getter/Setter RemoteObject property and ObjectPreview handling consistent https://bugs.webkit.org/show_bug.cgi?id=141587 Reviewed by Timothy Hatcher. Source/JavaScriptCore: Convert getProperties(ownAndGetterProperties) to getDisplayableProperties(). Mark PropertyDescriptors that are presumed to be native getters / bindings separately so that the frontend may display them differently. * inspector/InjectedScript.cpp: (Inspector::InjectedScript::getProperties): (Inspector::InjectedScript::getDisplayableProperties): * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getProperties): (Inspector::InspectorRuntimeAgent::getDisplayableProperties): * inspector/agents/InspectorRuntimeAgent.h: * inspector/protocol/Runtime.json: Source/WebInspectorUI: * UserInterface/Models/CallFrame.js: (WebInspector.CallFrame.prototype.collectScopeChainVariableNames): * UserInterface/Models/PropertyDescriptor.js: (WebInspector.PropertyDescriptor.prototype.get nativeGetter): * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.fromPayload): (WebInspector.RemoteObject.prototype.getOwnPropertyDescriptors): (WebInspector.RemoteObject.prototype.getAllPropertyDescriptors): (WebInspector.RemoteObject.prototype.getDisplayablePropertyDescriptors): (WebInspector.RemoteObject.prototype._getPropertyDescriptors): (WebInspector.RemoteObject.prototype.if): (WebInspector.RemoteObject.prototype.deprecatedGetOwnProperties): (WebInspector.RemoteObject.prototype.deprecatedGetAllProperties): (WebInspector.RemoteObject.prototype._deprecatedGetProperties): (WebInspector.RemoteObject.prototype.getOwnAndGetterPropertyDescriptors): Deleted. (WebInspector.RemoteObject.prototype.callback): Deleted. (WebInspector.RemoteObject.prototype.getOwnProperties): Deleted. (WebInspector.RemoteObject.prototype.getOwnAndGetterProperties): Deleted. (WebInspector.RemoteObject.prototype.getAllProperties): Deleted. (WebInspector.RemoteObject.prototype.set else): Deleted. * UserInterface/Views/ConsoleMessageImpl.js: (WebInspector.ConsoleMessageImpl.prototype._formatParameterAsArray): * UserInterface/Views/DOMNodeDetailsSidebarPanel.js: (WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshProperties.nodePrototypesReady): * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.ObjectPropertiesSection.prototype.update): (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate): * UserInterface/Views/ObjectTreePropertyTreeElement.js: (WebInspector.ObjectTreePropertyTreeElement.prototype.): (WebInspector.ObjectTreePropertyTreeElement.prototype): * UserInterface/Views/ObjectTreeView.js: (WebInspector.ObjectTreeView.prototype.update): LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: * inspector/model/remote-object-get-properties.html: Canonical link: https://commits.webkit.org/160009@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180594 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-02-25 00:31:42 +00:00
DISPLAYABLE PROPERTIES:
length
name
arguments
Partly implement Function.prototype.{caller,arguments} reflection proposal https://bugs.webkit.org/show_bug.cgi?id=158116 Reviewed by Yusuke Suzuki. JSTests: * ChakraCore/test/strict/19.function.baseline: * ChakraCore/test/strict/22.callerCalleeArguments.baseline-jsc: * microbenchmarks/function-prototype-get.js: Added. * microbenchmarks/reflect-own-keys-function.js: Added. * stress/for-in-shadow-non-enumerable.js: * stress/function-hidden-as-caller.js: * stress/has-own-property-arguments.js: * stress/object-assign-fast-path.js: * stress/put-to-proto-chain-overrides-put.js: * stress/reflect-set.js: * test262/config.yaml: Skip 3 test cases that are now incorrect. * test262/expectations.yaml: Mark 2 test cases as passing. Source/JavaScriptCore: To ensure web-compatibility, only the safe subset of Function.prototype.{caller,arguments} reflection proposal [1] is implemented, which is currently shipped in SpiderMonkey. Complete list of differences from the proposed spec: 1. Cross-realm receiver function is allowed instead of throwing a TypeError. Throwing is likely safe to ship, but #225997 needs to be fixed first for custom properties to receive correct global object. 2. Cross-realm caller function is returned instead of `null`. Hiding cross-realm caller may break things: we currently have a test for the opposite behavior. 3. Defines "caller" and "arguments" setters that throw for disallowed receivers, instead failing silently in sloppy mode. This is actually more restrictive than the spec, which is preferable, and aligns with V8 and SM. Most importantly, this patch removes own "caller" and "arguments" properties from sloppy mode ES5 functions. They were non-configurable, making it harder to use their holder as a [[ProxyTarget]]. They were also non-writable, with a constantly changing [[Value]], which violated the invariants of internal methods [2]. As a result, JSFunction methods are greatly simplified, especially defineOwnProperty() and getOwnSpecialPropertyNames(). The latter is now 2.1x faster according to the provided microbenchmark. Also, removes double "prototype" lookup from [[Get]], which is a 10% progression. [1]: https://github.com/claudepache/es-legacy-function-reflection [2]: https://tc39.es/ecma262/#sec-invariants-of-the-essential-internal-methods * runtime/ClonedArguments.cpp: (JSC::ClonedArguments::getOwnPropertySlot): (JSC::ClonedArguments::materializeSpecials): * runtime/FunctionExecutable.h: * runtime/FunctionPrototype.cpp: (JSC::FunctionPrototype::addFunctionProperties): (JSC::isAllowedReceiverFunctionForCallerAndArguments): (JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor): (JSC::RetrieveArgumentsFunctor::result const): (JSC::RetrieveArgumentsFunctor::operator() const): (JSC::retrieveArguments): (JSC::JSC_DEFINE_CUSTOM_GETTER): (JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor): (JSC::RetrieveCallerFunctionFunctor::result const): (JSC::RetrieveCallerFunctionFunctor::operator() const): (JSC::retrieveCallerFunction): (JSC::JSC_DEFINE_CUSTOM_SETTER): (JSC::FunctionPrototype::initRestrictedProperties): Deleted. * runtime/FunctionPrototype.h: * runtime/JSFunction.cpp: (JSC::JSFunction::getOwnPropertySlot): (JSC::JSFunction::getOwnSpecialPropertyNames): (JSC::JSFunction::put): (JSC::JSFunction::deleteProperty): (JSC::JSFunction::defineOwnProperty): (JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor): Deleted. (JSC::RetrieveArgumentsFunctor::result const): Deleted. (JSC::RetrieveArgumentsFunctor::operator() const): Deleted. (JSC::retrieveArguments): Deleted. (JSC::JSC_DEFINE_CUSTOM_GETTER): Deleted. (JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor): Deleted. (JSC::RetrieveCallerFunctionFunctor::result const): Deleted. (JSC::RetrieveCallerFunctionFunctor::operator() const): Deleted. (JSC::retrieveCallerFunction): Deleted. * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): (JSC::JSGlobalObject::visitChildrenImpl): * runtime/JSGlobalObject.h: Remove unused m_throwTypeErrorGetterSetter and make [[ThrowTypeError]] lazily-created. * runtime/JSGlobalObjectFunctions.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * runtime/JSGlobalObjectFunctions.h: * runtime/JSObject.cpp: (JSC::JSObject::putDirectCustomGetterSetterWithoutTransition): * runtime/JSObject.h: LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: * inspector/runtime/getDisplayableProperties-expected.txt: * inspector/runtime/getProperties-expected.txt: * js/Object-getOwnPropertyNames-expected.txt: * js/basic-strict-mode-expected.txt: * js/kde/function_arguments-expected.txt: * js/kde/script-tests/function_arguments.js: * js/non-strict-function-properties-expected.txt: * js/script-tests/Object-getOwnPropertyNames.js: * js/script-tests/basic-strict-mode.js: * js/script-tests/non-strict-function-properties.js: * js/script-tests/throw-type-error-is-unique.js: Canonical link: https://commits.webkit.org/239947@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-25 22:32:20 +00:00
caller
__proto__
targetFunction
boundThis
boundArgs
ALL PROPERTIES:
length
name
toString
apply
call
bind
arguments
Partly implement Function.prototype.{caller,arguments} reflection proposal https://bugs.webkit.org/show_bug.cgi?id=158116 Reviewed by Yusuke Suzuki. JSTests: * ChakraCore/test/strict/19.function.baseline: * ChakraCore/test/strict/22.callerCalleeArguments.baseline-jsc: * microbenchmarks/function-prototype-get.js: Added. * microbenchmarks/reflect-own-keys-function.js: Added. * stress/for-in-shadow-non-enumerable.js: * stress/function-hidden-as-caller.js: * stress/has-own-property-arguments.js: * stress/object-assign-fast-path.js: * stress/put-to-proto-chain-overrides-put.js: * stress/reflect-set.js: * test262/config.yaml: Skip 3 test cases that are now incorrect. * test262/expectations.yaml: Mark 2 test cases as passing. Source/JavaScriptCore: To ensure web-compatibility, only the safe subset of Function.prototype.{caller,arguments} reflection proposal [1] is implemented, which is currently shipped in SpiderMonkey. Complete list of differences from the proposed spec: 1. Cross-realm receiver function is allowed instead of throwing a TypeError. Throwing is likely safe to ship, but #225997 needs to be fixed first for custom properties to receive correct global object. 2. Cross-realm caller function is returned instead of `null`. Hiding cross-realm caller may break things: we currently have a test for the opposite behavior. 3. Defines "caller" and "arguments" setters that throw for disallowed receivers, instead failing silently in sloppy mode. This is actually more restrictive than the spec, which is preferable, and aligns with V8 and SM. Most importantly, this patch removes own "caller" and "arguments" properties from sloppy mode ES5 functions. They were non-configurable, making it harder to use their holder as a [[ProxyTarget]]. They were also non-writable, with a constantly changing [[Value]], which violated the invariants of internal methods [2]. As a result, JSFunction methods are greatly simplified, especially defineOwnProperty() and getOwnSpecialPropertyNames(). The latter is now 2.1x faster according to the provided microbenchmark. Also, removes double "prototype" lookup from [[Get]], which is a 10% progression. [1]: https://github.com/claudepache/es-legacy-function-reflection [2]: https://tc39.es/ecma262/#sec-invariants-of-the-essential-internal-methods * runtime/ClonedArguments.cpp: (JSC::ClonedArguments::getOwnPropertySlot): (JSC::ClonedArguments::materializeSpecials): * runtime/FunctionExecutable.h: * runtime/FunctionPrototype.cpp: (JSC::FunctionPrototype::addFunctionProperties): (JSC::isAllowedReceiverFunctionForCallerAndArguments): (JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor): (JSC::RetrieveArgumentsFunctor::result const): (JSC::RetrieveArgumentsFunctor::operator() const): (JSC::retrieveArguments): (JSC::JSC_DEFINE_CUSTOM_GETTER): (JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor): (JSC::RetrieveCallerFunctionFunctor::result const): (JSC::RetrieveCallerFunctionFunctor::operator() const): (JSC::retrieveCallerFunction): (JSC::JSC_DEFINE_CUSTOM_SETTER): (JSC::FunctionPrototype::initRestrictedProperties): Deleted. * runtime/FunctionPrototype.h: * runtime/JSFunction.cpp: (JSC::JSFunction::getOwnPropertySlot): (JSC::JSFunction::getOwnSpecialPropertyNames): (JSC::JSFunction::put): (JSC::JSFunction::deleteProperty): (JSC::JSFunction::defineOwnProperty): (JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor): Deleted. (JSC::RetrieveArgumentsFunctor::result const): Deleted. (JSC::RetrieveArgumentsFunctor::operator() const): Deleted. (JSC::retrieveArguments): Deleted. (JSC::JSC_DEFINE_CUSTOM_GETTER): Deleted. (JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor): Deleted. (JSC::RetrieveCallerFunctionFunctor::result const): Deleted. (JSC::RetrieveCallerFunctionFunctor::operator() const): Deleted. (JSC::retrieveCallerFunction): Deleted. * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): (JSC::JSGlobalObject::visitChildrenImpl): * runtime/JSGlobalObject.h: Remove unused m_throwTypeErrorGetterSetter and make [[ThrowTypeError]] lazily-created. * runtime/JSGlobalObjectFunctions.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * runtime/JSGlobalObjectFunctions.h: * runtime/JSObject.cpp: (JSC::JSObject::putDirectCustomGetterSetterWithoutTransition): * runtime/JSObject.h: LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: * inspector/runtime/getDisplayableProperties-expected.txt: * inspector/runtime/getProperties-expected.txt: * js/Object-getOwnPropertyNames-expected.txt: * js/basic-strict-mode-expected.txt: * js/kde/function_arguments-expected.txt: * js/kde/script-tests/function_arguments.js: * js/non-strict-function-properties-expected.txt: * js/script-tests/Object-getOwnPropertyNames.js: * js/script-tests/basic-strict-mode.js: * js/script-tests/non-strict-function-properties.js: * js/script-tests/throw-type-error-is-unique.js: Canonical link: https://commits.webkit.org/239947@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-25 22:32:20 +00:00
caller
constructor
[ES6] Add support for Symbol.hasInstance https://bugs.webkit.org/show_bug.cgi?id=151839 Reviewed by Saam Barati. Source/JavaScriptCore: Fixed version of r193986, r193983, and r193974. This patch adds support for Symbol.hasInstance, unfortunately in order to prevent regressions several new bytecodes and DFG IR nodes were necessary. Before, Symbol.hasInstance when executing an instanceof expression we would emit three bytecodes: overrides_has_instance, get_by_id, then instanceof. As the spec has changed, we emit a more complicated set of bytecodes in addition to some new ones. First the role of overrides_has_instance and its corresponding DFG node have changed. Now it returns a js-boolean indicating whether the RHS of the instanceof expression (from here on called the constructor for simplicity) needs non-default behavior for resolving the expression. i.e. The constructor has a Symbol.hasInstance that differs from the one on Function.prototype[Symbol.hasInstance] or is a bound/C-API function. Once we get to the DFG this node is generally eliminated as we can prove the value of Symbol.hasInstance is a constant. The second new bytecode is instanceof_custom. insntanceof_custom, just emits a call to slow path code that computes the result. In the DFG, there is also a new node, CheckTypeInfoFlags, which checks the type info flags are consistent with the ones provided and OSR exits if the flags are not. Additionally, we attempt to prove that the result of CheckHasValue will be a constant and transform it into a CheckTypeInfoFlags followed by a JSConstant. * API/JSCallbackObject.h: * builtins/FunctionPrototype.js: (symbolHasInstance): * bytecode/BytecodeBasicBlock.cpp: (JSC::isBranch): Deleted. * bytecode/BytecodeList.json: * bytecode/BytecodeUseDef.h: (JSC::computeUsesForBytecodeOffset): (JSC::computeDefsForBytecodeOffset): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dumpBytecode): * bytecode/ExitKind.cpp: (JSC::exitKindToString): * bytecode/ExitKind.h: * bytecode/PreciseJumpTargets.cpp: (JSC::getJumpTargetsForBytecodeOffset): Deleted. * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitOverridesHasInstance): (JSC::BytecodeGenerator::emitInstanceOfCustom): (JSC::BytecodeGenerator::emitCheckHasInstance): Deleted. * bytecompiler/BytecodeGenerator.h: * bytecompiler/NodesCodegen.cpp: (JSC::InstanceOfNode::emitBytecode): * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::parseBlock): * dfg/DFGCapabilities.cpp: (JSC::DFG::capabilityLevel): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): * dfg/DFGDoesGC.cpp: (JSC::DFG::doesGC): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGHeapLocation.cpp: (WTF::printInternal): * dfg/DFGHeapLocation.h: * dfg/DFGNode.h: (JSC::DFG::Node::hasCellOperand): (JSC::DFG::Node::hasTypeInfoOperand): (JSC::DFG::Node::typeInfoOperand): * dfg/DFGNodeType.h: * dfg/DFGPredictionPropagationPhase.cpp: (JSC::DFG::PredictionPropagationPhase::propagate): * dfg/DFGSafeToExecute.h: (JSC::DFG::safeToExecute): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileCheckTypeInfoFlags): (JSC::DFG::SpeculativeJIT::compileInstanceOfCustom): * dfg/DFGSpeculativeJIT.h: (JSC::DFG::SpeculativeJIT::callOperation): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLIntrinsicRepository.h: * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::DFG::LowerDFGToLLVM::compileNode): (JSC::FTL::DFG::LowerDFGToLLVM::compileOverridesHasInstance): (JSC::FTL::DFG::LowerDFGToLLVM::compileCheckTypeInfoFlags): (JSC::FTL::DFG::LowerDFGToLLVM::compileInstanceOfCustom): (JSC::FTL::DFG::LowerDFGToLLVM::compileCheckHasInstance): Deleted. * jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases): * jit/JIT.h: * jit/JITInlines.h: (JSC::JIT::callOperation): * jit/JITOpcodes.cpp: (JSC::JIT::emit_op_overrides_has_instance): (JSC::JIT::emit_op_instanceof): (JSC::JIT::emit_op_instanceof_custom): (JSC::JIT::emitSlow_op_instanceof): (JSC::JIT::emitSlow_op_instanceof_custom): (JSC::JIT::emit_op_check_has_instance): Deleted. (JSC::JIT::emitSlow_op_check_has_instance): Deleted. * jit/JITOpcodes32_64.cpp: (JSC::JIT::emit_op_overrides_has_instance): (JSC::JIT::emit_op_instanceof): (JSC::JIT::emit_op_instanceof_custom): (JSC::JIT::emitSlow_op_instanceof_custom): (JSC::JIT::emit_op_check_has_instance): Deleted. (JSC::JIT::emitSlow_op_check_has_instance): Deleted. * jit/JITOperations.cpp: * jit/JITOperations.h: * llint/LLIntData.cpp: (JSC::LLInt::Data::performAssertions): * llint/LLIntSlowPaths.cpp: (JSC::LLInt::LLINT_SLOW_PATH_DECL): * llint/LLIntSlowPaths.h: * llint/LowLevelInterpreter32_64.asm: * llint/LowLevelInterpreter64.asm: * runtime/CommonIdentifiers.h: * runtime/ExceptionHelpers.cpp: (JSC::invalidParameterInstanceofSourceAppender): (JSC::invalidParameterInstanceofNotFunctionSourceAppender): (JSC::invalidParameterInstanceofhasInstanceValueNotFunctionSourceAppender): (JSC::createInvalidInstanceofParameterErrorNotFunction): (JSC::createInvalidInstanceofParameterErrorhasInstanceValueNotFunction): (JSC::createInvalidInstanceofParameterError): Deleted. * runtime/ExceptionHelpers.h: * runtime/FunctionPrototype.cpp: (JSC::FunctionPrototype::addFunctionProperties): * runtime/FunctionPrototype.h: * runtime/JSBoundFunction.cpp: (JSC::isBoundFunction): (JSC::hasInstanceBoundFunction): * runtime/JSBoundFunction.h: * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): (JSC::JSGlobalObject::visitChildren): * runtime/JSGlobalObject.h: (JSC::JSGlobalObject::functionProtoHasInstanceSymbolFunction): * runtime/JSObject.cpp: (JSC::JSObject::hasInstance): (JSC::objectPrivateFuncInstanceOf): * runtime/JSObject.h: * runtime/JSTypeInfo.h: (JSC::TypeInfo::TypeInfo): (JSC::TypeInfo::overridesHasInstance): * runtime/WriteBarrier.h: (JSC::WriteBarrierBase<Unknown>::slot): * tests/es6.yaml: * tests/stress/instanceof-custom-hasinstancesymbol.js: Added. (Constructor): (value): (instanceOf): (body): * tests/stress/symbol-hasInstance.js: Added. (Constructor): (value): (ObjectClass.Symbol.hasInstance): (NumberClass.Symbol.hasInstance): LayoutTests: Fix tests to reflect the changes to instanceof in ES6. Added a new regression test for bound functions in instanceof as the perfomance on bound functions should, to some degree, reflect the performance on C-API users. * inspector/model/remote-object-get-properties-expected.txt: * js/Object-getOwnPropertyNames-expected.txt: * js/exception-for-nonobject-expected.txt: * js/exception-instanceof-expected.txt: * js/instance-of-immediates-expected.txt: * js/regress/instanceof-bound-expected.txt: Added. * js/regress/instanceof-bound.html: Added. * js/regress/script-tests/instanceof-bound.js: Added. (Constructor): (test): * js/script-tests/Object-getOwnPropertyNames.js: Canonical link: https://commits.webkit.org/170515@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194248 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-18 00:37:35 +00:00
Symbol(Symbol.hasInstance)
toLocaleString
valueOf
hasOwnProperty
propertyIsEnumerable
isPrototypeOf
__defineGetter__
__defineSetter__
__lookupGetter__
__lookupSetter__
__proto__
targetFunction
boundThis
boundArgs
-----------------------------------------------------
Web Inspector: ES6: Show Symbol properties on Objects https://bugs.webkit.org/show_bug.cgi?id=141279 Reviewed by Timothy Hatcher. Source/JavaScriptCore: * inspector/protocol/Runtime.json: Give PropertyDescriptor a reference to the Symbol RemoteObject if the property is a symbol property. * inspector/InjectedScriptSource.js: Enumerate symbol properties on objects. Source/WebInspectorUI: * Localizations/en.lproj/localizedStrings.js: * UserInterface/Models/PropertyDescriptor.js: (WebInspector.PropertyDescriptor.get symbol): * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.wrappedCallback): Update new PropertyDescriptor call site. * UserInterface/Views/ObjectTreeBaseTreeElement.js: (WebInspector.ObjectTreeBaseTreeElement._logSymbolProperty): Provide a context menu for rows with Symbol properties to log the Symbol property, and therefore get a reference to it. * UserInterface/Views/ObjectTreeView.js: (WebInspector.ObjectTreeView.comparePropertyDescriptors): Better handle symbol properties in sorting. * UserInterface/Views/TypePropertiesSection.js: (WebInspector.TypePropertiesSection.PropertyComparator): Return better value when values are equal. LayoutTests: * inspector/model/remote-object-expected.txt: * inspector/model/remote-object-get-properties-expected.txt: * inspector/model/remote-object-get-properties.html: * inspector/model/remote-object.html: Update tests to include objects with Symbol properties. Canonical link: https://commits.webkit.org/161514@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182493 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-04-07 21:28:57 +00:00
-----------------------------------------------------
EXPRESSION: window.objectWithSymbolProperties
type: object
description: Object
OWN PROPERTIES:
prop
prop2
Symbol()
Symbol(sym)
Symbol(sym)
Symbol()
Remove className() and toStringName() from the method table https://bugs.webkit.org/show_bug.cgi?id=224247 Reviewed by Darin Adler. Source/JavaScriptCore: ES6 introduced Symbol.toStringTag to customize Object.prototype.toString return value. It was adopted by WebIDL spec, Chrome's DevTools, Node.js etc. There is no reason to keep 2 method table methods, each with only 1 call site, instead of using the symbol. Also, it's a bit confusing that for some objects, method table's className() returns different result than JSCell::className(VM&). This change: 1. Removes JSProxy's className() / toStringName() methods because its target() is a global object that never has these overrides and uses Symbol.toStringTag instead. 2. Removes DebuggerScope's className() / toStringName() overrides because its objectAtScope() has these methods extremely rarely (e.g. `with (new Date) {}`), and its not displayed by Web Inspector. 3. Merges JSCallbackObject's className() / toStringName() methods into Symbol.toStringTag branch of getOwnPropertySlot(), with permissive property attributes. To avoid any possible breakage, we make sure that it will be shadowed by a structure property. 4. Reworks JSObject::calculatedClassName() to rely on Symbol.toStringTag, matching Chrome's DevTools behavior. On its own, it's a nice change for Web Inspector. We make sure to lookup Symbol.toStringTag if `constructor.name` inference fails to avoid confusion when extending builtins. 5. Removes now unused className() from the method table. 6. Removes toStringName() override from JSFinalizationRegistry because its builtin tag [1] is already "Object". 7. Introduces BooleanObjectType for Boolean wrapper object, and Boolean.prototype as it's also required to have a [[BooleanData]] internal slot [2]. 8. Reworks Object.prototype.toString to determine builtin tag [1] based on JSType rather than performing method table call. It's guaranteed that a) the set of types we are checking against won't be expanded, and b) objects with these types have correct `className`. 9. Removes now unused toStringTag() from the method table. This patch is performance-neutral and carefully preserves current behavior for API objects, including isPokerBros() hack. [1]: https://tc39.es/ecma262/#sec-object.prototype.tostring (steps 5-14) [2]: https://tc39.es/ecma262/#sec-properties-of-the-boolean-prototype-object * API/JSCallbackObject.h: * API/JSCallbackObjectFunctions.h: (JSC::JSCallbackObject<Parent>::getOwnPropertySlot): (JSC::JSCallbackObject<Parent>::className): Deleted. (JSC::JSCallbackObject<Parent>::toStringName): Deleted. * API/tests/testapiScripts/testapi.js: * debugger/DebuggerScope.cpp: (JSC::DebuggerScope::className): Deleted. (JSC::DebuggerScope::toStringName): Deleted. * debugger/DebuggerScope.h: * runtime/BooleanObject.cpp: (JSC::BooleanObject::toStringName): Deleted. * runtime/BooleanObject.h: (JSC::BooleanObject::createStructure): * runtime/BooleanPrototype.h: * runtime/ClassInfo.h: * runtime/DateInstance.cpp: (JSC::DateInstance::toStringName): Deleted. * runtime/DateInstance.h: * runtime/ErrorInstance.cpp: (JSC::ErrorInstance::toStringName): Deleted. * runtime/ErrorInstance.h: * runtime/JSCell.cpp: (JSC::JSCell::className): Deleted. (JSC::JSCell::toStringName): Deleted. * runtime/JSCell.h: * runtime/JSFinalizationRegistry.cpp: (JSC::JSFinalizationRegistry::toStringName): Deleted. * runtime/JSFinalizationRegistry.h: * runtime/JSObject.cpp: (JSC::JSObject::calculatedClassName): (JSC::JSObject::className): Deleted. (JSC::isPokerBros): Deleted. (JSC::JSObject::toStringName): Deleted. * runtime/JSObject.h: * runtime/JSProxy.cpp: (JSC::JSProxy::className): Deleted. (JSC::JSProxy::toStringName): Deleted. * runtime/JSProxy.h: * runtime/JSType.cpp: (WTF::printInternal): * runtime/JSType.h: * runtime/NumberObject.cpp: (JSC::NumberObject::toStringName): Deleted. * runtime/NumberObject.h: (JSC::NumberObject::createStructure): * runtime/ObjectPrototype.cpp: (JSC::isPokerBros): (JSC::inferBuiltinTag): (JSC::objectPrototypeToString): 1. Removes jsNontrivialString() because it's assertion may fail in case of iOS hack. 2. Utilizes AtomStringImpl to avoid allocating StringImpl for a small fixed set of strings. * runtime/RegExpObject.cpp: (JSC::RegExpObject::toStringName): Deleted. * runtime/RegExpObject.h: * runtime/StringObject.cpp: (JSC::StringObject::toStringName): Deleted. * runtime/StringObject.h: LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: * inspector/model/remote-object-get-properties.html: Canonical link: https://commits.webkit.org/236359@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-10 01:00:15 +00:00
Symbol(Symbol.toStringTag)
Web Inspector: ES6: Show Symbol properties on Objects https://bugs.webkit.org/show_bug.cgi?id=141279 Reviewed by Timothy Hatcher. Source/JavaScriptCore: * inspector/protocol/Runtime.json: Give PropertyDescriptor a reference to the Symbol RemoteObject if the property is a symbol property. * inspector/InjectedScriptSource.js: Enumerate symbol properties on objects. Source/WebInspectorUI: * Localizations/en.lproj/localizedStrings.js: * UserInterface/Models/PropertyDescriptor.js: (WebInspector.PropertyDescriptor.get symbol): * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.wrappedCallback): Update new PropertyDescriptor call site. * UserInterface/Views/ObjectTreeBaseTreeElement.js: (WebInspector.ObjectTreeBaseTreeElement._logSymbolProperty): Provide a context menu for rows with Symbol properties to log the Symbol property, and therefore get a reference to it. * UserInterface/Views/ObjectTreeView.js: (WebInspector.ObjectTreeView.comparePropertyDescriptors): Better handle symbol properties in sorting. * UserInterface/Views/TypePropertiesSection.js: (WebInspector.TypePropertiesSection.PropertyComparator): Return better value when values are equal. LayoutTests: * inspector/model/remote-object-expected.txt: * inspector/model/remote-object-get-properties-expected.txt: * inspector/model/remote-object-get-properties.html: * inspector/model/remote-object.html: Update tests to include objects with Symbol properties. Canonical link: https://commits.webkit.org/161514@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182493 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-04-07 21:28:57 +00:00
__proto__
DISPLAYABLE PROPERTIES:
prop
prop2
Symbol()
Symbol(sym)
Symbol(sym)
Symbol()
Remove className() and toStringName() from the method table https://bugs.webkit.org/show_bug.cgi?id=224247 Reviewed by Darin Adler. Source/JavaScriptCore: ES6 introduced Symbol.toStringTag to customize Object.prototype.toString return value. It was adopted by WebIDL spec, Chrome's DevTools, Node.js etc. There is no reason to keep 2 method table methods, each with only 1 call site, instead of using the symbol. Also, it's a bit confusing that for some objects, method table's className() returns different result than JSCell::className(VM&). This change: 1. Removes JSProxy's className() / toStringName() methods because its target() is a global object that never has these overrides and uses Symbol.toStringTag instead. 2. Removes DebuggerScope's className() / toStringName() overrides because its objectAtScope() has these methods extremely rarely (e.g. `with (new Date) {}`), and its not displayed by Web Inspector. 3. Merges JSCallbackObject's className() / toStringName() methods into Symbol.toStringTag branch of getOwnPropertySlot(), with permissive property attributes. To avoid any possible breakage, we make sure that it will be shadowed by a structure property. 4. Reworks JSObject::calculatedClassName() to rely on Symbol.toStringTag, matching Chrome's DevTools behavior. On its own, it's a nice change for Web Inspector. We make sure to lookup Symbol.toStringTag if `constructor.name` inference fails to avoid confusion when extending builtins. 5. Removes now unused className() from the method table. 6. Removes toStringName() override from JSFinalizationRegistry because its builtin tag [1] is already "Object". 7. Introduces BooleanObjectType for Boolean wrapper object, and Boolean.prototype as it's also required to have a [[BooleanData]] internal slot [2]. 8. Reworks Object.prototype.toString to determine builtin tag [1] based on JSType rather than performing method table call. It's guaranteed that a) the set of types we are checking against won't be expanded, and b) objects with these types have correct `className`. 9. Removes now unused toStringTag() from the method table. This patch is performance-neutral and carefully preserves current behavior for API objects, including isPokerBros() hack. [1]: https://tc39.es/ecma262/#sec-object.prototype.tostring (steps 5-14) [2]: https://tc39.es/ecma262/#sec-properties-of-the-boolean-prototype-object * API/JSCallbackObject.h: * API/JSCallbackObjectFunctions.h: (JSC::JSCallbackObject<Parent>::getOwnPropertySlot): (JSC::JSCallbackObject<Parent>::className): Deleted. (JSC::JSCallbackObject<Parent>::toStringName): Deleted. * API/tests/testapiScripts/testapi.js: * debugger/DebuggerScope.cpp: (JSC::DebuggerScope::className): Deleted. (JSC::DebuggerScope::toStringName): Deleted. * debugger/DebuggerScope.h: * runtime/BooleanObject.cpp: (JSC::BooleanObject::toStringName): Deleted. * runtime/BooleanObject.h: (JSC::BooleanObject::createStructure): * runtime/BooleanPrototype.h: * runtime/ClassInfo.h: * runtime/DateInstance.cpp: (JSC::DateInstance::toStringName): Deleted. * runtime/DateInstance.h: * runtime/ErrorInstance.cpp: (JSC::ErrorInstance::toStringName): Deleted. * runtime/ErrorInstance.h: * runtime/JSCell.cpp: (JSC::JSCell::className): Deleted. (JSC::JSCell::toStringName): Deleted. * runtime/JSCell.h: * runtime/JSFinalizationRegistry.cpp: (JSC::JSFinalizationRegistry::toStringName): Deleted. * runtime/JSFinalizationRegistry.h: * runtime/JSObject.cpp: (JSC::JSObject::calculatedClassName): (JSC::JSObject::className): Deleted. (JSC::isPokerBros): Deleted. (JSC::JSObject::toStringName): Deleted. * runtime/JSObject.h: * runtime/JSProxy.cpp: (JSC::JSProxy::className): Deleted. (JSC::JSProxy::toStringName): Deleted. * runtime/JSProxy.h: * runtime/JSType.cpp: (WTF::printInternal): * runtime/JSType.h: * runtime/NumberObject.cpp: (JSC::NumberObject::toStringName): Deleted. * runtime/NumberObject.h: (JSC::NumberObject::createStructure): * runtime/ObjectPrototype.cpp: (JSC::isPokerBros): (JSC::inferBuiltinTag): (JSC::objectPrototypeToString): 1. Removes jsNontrivialString() because it's assertion may fail in case of iOS hack. 2. Utilizes AtomStringImpl to avoid allocating StringImpl for a small fixed set of strings. * runtime/RegExpObject.cpp: (JSC::RegExpObject::toStringName): Deleted. * runtime/RegExpObject.h: * runtime/StringObject.cpp: (JSC::StringObject::toStringName): Deleted. * runtime/StringObject.h: LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: * inspector/model/remote-object-get-properties.html: Canonical link: https://commits.webkit.org/236359@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-10 01:00:15 +00:00
Symbol(Symbol.toStringTag)
Web Inspector: ES6: Show Symbol properties on Objects https://bugs.webkit.org/show_bug.cgi?id=141279 Reviewed by Timothy Hatcher. Source/JavaScriptCore: * inspector/protocol/Runtime.json: Give PropertyDescriptor a reference to the Symbol RemoteObject if the property is a symbol property. * inspector/InjectedScriptSource.js: Enumerate symbol properties on objects. Source/WebInspectorUI: * Localizations/en.lproj/localizedStrings.js: * UserInterface/Models/PropertyDescriptor.js: (WebInspector.PropertyDescriptor.get symbol): * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.wrappedCallback): Update new PropertyDescriptor call site. * UserInterface/Views/ObjectTreeBaseTreeElement.js: (WebInspector.ObjectTreeBaseTreeElement._logSymbolProperty): Provide a context menu for rows with Symbol properties to log the Symbol property, and therefore get a reference to it. * UserInterface/Views/ObjectTreeView.js: (WebInspector.ObjectTreeView.comparePropertyDescriptors): Better handle symbol properties in sorting. * UserInterface/Views/TypePropertiesSection.js: (WebInspector.TypePropertiesSection.PropertyComparator): Return better value when values are equal. LayoutTests: * inspector/model/remote-object-expected.txt: * inspector/model/remote-object-get-properties-expected.txt: * inspector/model/remote-object-get-properties.html: * inspector/model/remote-object.html: Update tests to include objects with Symbol properties. Canonical link: https://commits.webkit.org/161514@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182493 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-04-07 21:28:57 +00:00
__proto__
ALL PROPERTIES:
prop
prop2
Symbol()
Symbol(sym)
Symbol(sym)
Symbol()
Remove className() and toStringName() from the method table https://bugs.webkit.org/show_bug.cgi?id=224247 Reviewed by Darin Adler. Source/JavaScriptCore: ES6 introduced Symbol.toStringTag to customize Object.prototype.toString return value. It was adopted by WebIDL spec, Chrome's DevTools, Node.js etc. There is no reason to keep 2 method table methods, each with only 1 call site, instead of using the symbol. Also, it's a bit confusing that for some objects, method table's className() returns different result than JSCell::className(VM&). This change: 1. Removes JSProxy's className() / toStringName() methods because its target() is a global object that never has these overrides and uses Symbol.toStringTag instead. 2. Removes DebuggerScope's className() / toStringName() overrides because its objectAtScope() has these methods extremely rarely (e.g. `with (new Date) {}`), and its not displayed by Web Inspector. 3. Merges JSCallbackObject's className() / toStringName() methods into Symbol.toStringTag branch of getOwnPropertySlot(), with permissive property attributes. To avoid any possible breakage, we make sure that it will be shadowed by a structure property. 4. Reworks JSObject::calculatedClassName() to rely on Symbol.toStringTag, matching Chrome's DevTools behavior. On its own, it's a nice change for Web Inspector. We make sure to lookup Symbol.toStringTag if `constructor.name` inference fails to avoid confusion when extending builtins. 5. Removes now unused className() from the method table. 6. Removes toStringName() override from JSFinalizationRegistry because its builtin tag [1] is already "Object". 7. Introduces BooleanObjectType for Boolean wrapper object, and Boolean.prototype as it's also required to have a [[BooleanData]] internal slot [2]. 8. Reworks Object.prototype.toString to determine builtin tag [1] based on JSType rather than performing method table call. It's guaranteed that a) the set of types we are checking against won't be expanded, and b) objects with these types have correct `className`. 9. Removes now unused toStringTag() from the method table. This patch is performance-neutral and carefully preserves current behavior for API objects, including isPokerBros() hack. [1]: https://tc39.es/ecma262/#sec-object.prototype.tostring (steps 5-14) [2]: https://tc39.es/ecma262/#sec-properties-of-the-boolean-prototype-object * API/JSCallbackObject.h: * API/JSCallbackObjectFunctions.h: (JSC::JSCallbackObject<Parent>::getOwnPropertySlot): (JSC::JSCallbackObject<Parent>::className): Deleted. (JSC::JSCallbackObject<Parent>::toStringName): Deleted. * API/tests/testapiScripts/testapi.js: * debugger/DebuggerScope.cpp: (JSC::DebuggerScope::className): Deleted. (JSC::DebuggerScope::toStringName): Deleted. * debugger/DebuggerScope.h: * runtime/BooleanObject.cpp: (JSC::BooleanObject::toStringName): Deleted. * runtime/BooleanObject.h: (JSC::BooleanObject::createStructure): * runtime/BooleanPrototype.h: * runtime/ClassInfo.h: * runtime/DateInstance.cpp: (JSC::DateInstance::toStringName): Deleted. * runtime/DateInstance.h: * runtime/ErrorInstance.cpp: (JSC::ErrorInstance::toStringName): Deleted. * runtime/ErrorInstance.h: * runtime/JSCell.cpp: (JSC::JSCell::className): Deleted. (JSC::JSCell::toStringName): Deleted. * runtime/JSCell.h: * runtime/JSFinalizationRegistry.cpp: (JSC::JSFinalizationRegistry::toStringName): Deleted. * runtime/JSFinalizationRegistry.h: * runtime/JSObject.cpp: (JSC::JSObject::calculatedClassName): (JSC::JSObject::className): Deleted. (JSC::isPokerBros): Deleted. (JSC::JSObject::toStringName): Deleted. * runtime/JSObject.h: * runtime/JSProxy.cpp: (JSC::JSProxy::className): Deleted. (JSC::JSProxy::toStringName): Deleted. * runtime/JSProxy.h: * runtime/JSType.cpp: (WTF::printInternal): * runtime/JSType.h: * runtime/NumberObject.cpp: (JSC::NumberObject::toStringName): Deleted. * runtime/NumberObject.h: (JSC::NumberObject::createStructure): * runtime/ObjectPrototype.cpp: (JSC::isPokerBros): (JSC::inferBuiltinTag): (JSC::objectPrototypeToString): 1. Removes jsNontrivialString() because it's assertion may fail in case of iOS hack. 2. Utilizes AtomStringImpl to avoid allocating StringImpl for a small fixed set of strings. * runtime/RegExpObject.cpp: (JSC::RegExpObject::toStringName): Deleted. * runtime/RegExpObject.h: * runtime/StringObject.cpp: (JSC::StringObject::toStringName): Deleted. * runtime/StringObject.h: LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: * inspector/model/remote-object-get-properties.html: Canonical link: https://commits.webkit.org/236359@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-10 01:00:15 +00:00
Symbol(Symbol.toStringTag)
Web Inspector: ES6: Show Symbol properties on Objects https://bugs.webkit.org/show_bug.cgi?id=141279 Reviewed by Timothy Hatcher. Source/JavaScriptCore: * inspector/protocol/Runtime.json: Give PropertyDescriptor a reference to the Symbol RemoteObject if the property is a symbol property. * inspector/InjectedScriptSource.js: Enumerate symbol properties on objects. Source/WebInspectorUI: * Localizations/en.lproj/localizedStrings.js: * UserInterface/Models/PropertyDescriptor.js: (WebInspector.PropertyDescriptor.get symbol): * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.wrappedCallback): Update new PropertyDescriptor call site. * UserInterface/Views/ObjectTreeBaseTreeElement.js: (WebInspector.ObjectTreeBaseTreeElement._logSymbolProperty): Provide a context menu for rows with Symbol properties to log the Symbol property, and therefore get a reference to it. * UserInterface/Views/ObjectTreeView.js: (WebInspector.ObjectTreeView.comparePropertyDescriptors): Better handle symbol properties in sorting. * UserInterface/Views/TypePropertiesSection.js: (WebInspector.TypePropertiesSection.PropertyComparator): Return better value when values are equal. LayoutTests: * inspector/model/remote-object-expected.txt: * inspector/model/remote-object-get-properties-expected.txt: * inspector/model/remote-object-get-properties.html: * inspector/model/remote-object.html: Update tests to include objects with Symbol properties. Canonical link: https://commits.webkit.org/161514@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182493 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-04-07 21:28:57 +00:00
toString
toLocaleString
valueOf
hasOwnProperty
propertyIsEnumerable
isPrototypeOf
__defineGetter__
__defineSetter__
__lookupGetter__
__lookupSetter__
constructor
__proto__
-----------------------------------------------------
Remove className() and toStringName() from the method table https://bugs.webkit.org/show_bug.cgi?id=224247 Reviewed by Darin Adler. Source/JavaScriptCore: ES6 introduced Symbol.toStringTag to customize Object.prototype.toString return value. It was adopted by WebIDL spec, Chrome's DevTools, Node.js etc. There is no reason to keep 2 method table methods, each with only 1 call site, instead of using the symbol. Also, it's a bit confusing that for some objects, method table's className() returns different result than JSCell::className(VM&). This change: 1. Removes JSProxy's className() / toStringName() methods because its target() is a global object that never has these overrides and uses Symbol.toStringTag instead. 2. Removes DebuggerScope's className() / toStringName() overrides because its objectAtScope() has these methods extremely rarely (e.g. `with (new Date) {}`), and its not displayed by Web Inspector. 3. Merges JSCallbackObject's className() / toStringName() methods into Symbol.toStringTag branch of getOwnPropertySlot(), with permissive property attributes. To avoid any possible breakage, we make sure that it will be shadowed by a structure property. 4. Reworks JSObject::calculatedClassName() to rely on Symbol.toStringTag, matching Chrome's DevTools behavior. On its own, it's a nice change for Web Inspector. We make sure to lookup Symbol.toStringTag if `constructor.name` inference fails to avoid confusion when extending builtins. 5. Removes now unused className() from the method table. 6. Removes toStringName() override from JSFinalizationRegistry because its builtin tag [1] is already "Object". 7. Introduces BooleanObjectType for Boolean wrapper object, and Boolean.prototype as it's also required to have a [[BooleanData]] internal slot [2]. 8. Reworks Object.prototype.toString to determine builtin tag [1] based on JSType rather than performing method table call. It's guaranteed that a) the set of types we are checking against won't be expanded, and b) objects with these types have correct `className`. 9. Removes now unused toStringTag() from the method table. This patch is performance-neutral and carefully preserves current behavior for API objects, including isPokerBros() hack. [1]: https://tc39.es/ecma262/#sec-object.prototype.tostring (steps 5-14) [2]: https://tc39.es/ecma262/#sec-properties-of-the-boolean-prototype-object * API/JSCallbackObject.h: * API/JSCallbackObjectFunctions.h: (JSC::JSCallbackObject<Parent>::getOwnPropertySlot): (JSC::JSCallbackObject<Parent>::className): Deleted. (JSC::JSCallbackObject<Parent>::toStringName): Deleted. * API/tests/testapiScripts/testapi.js: * debugger/DebuggerScope.cpp: (JSC::DebuggerScope::className): Deleted. (JSC::DebuggerScope::toStringName): Deleted. * debugger/DebuggerScope.h: * runtime/BooleanObject.cpp: (JSC::BooleanObject::toStringName): Deleted. * runtime/BooleanObject.h: (JSC::BooleanObject::createStructure): * runtime/BooleanPrototype.h: * runtime/ClassInfo.h: * runtime/DateInstance.cpp: (JSC::DateInstance::toStringName): Deleted. * runtime/DateInstance.h: * runtime/ErrorInstance.cpp: (JSC::ErrorInstance::toStringName): Deleted. * runtime/ErrorInstance.h: * runtime/JSCell.cpp: (JSC::JSCell::className): Deleted. (JSC::JSCell::toStringName): Deleted. * runtime/JSCell.h: * runtime/JSFinalizationRegistry.cpp: (JSC::JSFinalizationRegistry::toStringName): Deleted. * runtime/JSFinalizationRegistry.h: * runtime/JSObject.cpp: (JSC::JSObject::calculatedClassName): (JSC::JSObject::className): Deleted. (JSC::isPokerBros): Deleted. (JSC::JSObject::toStringName): Deleted. * runtime/JSObject.h: * runtime/JSProxy.cpp: (JSC::JSProxy::className): Deleted. (JSC::JSProxy::toStringName): Deleted. * runtime/JSProxy.h: * runtime/JSType.cpp: (WTF::printInternal): * runtime/JSType.h: * runtime/NumberObject.cpp: (JSC::NumberObject::toStringName): Deleted. * runtime/NumberObject.h: (JSC::NumberObject::createStructure): * runtime/ObjectPrototype.cpp: (JSC::isPokerBros): (JSC::inferBuiltinTag): (JSC::objectPrototypeToString): 1. Removes jsNontrivialString() because it's assertion may fail in case of iOS hack. 2. Utilizes AtomStringImpl to avoid allocating StringImpl for a small fixed set of strings. * runtime/RegExpObject.cpp: (JSC::RegExpObject::toStringName): Deleted. * runtime/RegExpObject.h: * runtime/StringObject.cpp: (JSC::StringObject::toStringName): Deleted. * runtime/StringObject.h: LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: * inspector/model/remote-object-get-properties.html: Canonical link: https://commits.webkit.org/236359@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-10 01:00:15 +00:00
-----------------------------------------------------
EXPRESSION: window.objectWithSymbolToStringTag
type: object
description: Foo
OWN PROPERTIES:
Symbol(Symbol.toStringTag)
__proto__
DISPLAYABLE PROPERTIES:
Symbol(Symbol.toStringTag)
__proto__
ALL PROPERTIES:
Symbol(Symbol.toStringTag)
toString
toLocaleString
valueOf
hasOwnProperty
propertyIsEnumerable
isPrototypeOf
__defineGetter__
__defineSetter__
__lookupGetter__
__lookupSetter__
constructor
__proto__
-----------------------------------------------------
-----------------------------------------------------
EXPRESSION: window.objectWithShadowedSymbolToStringTag
type: object
description: Foo
OWN PROPERTIES:
__proto__
DISPLAYABLE PROPERTIES:
__proto__
ALL PROPERTIES:
constructor
addEventListener
removeEventListener
dispatchEvent
Symbol(Symbol.toStringTag)
toString
toLocaleString
valueOf
hasOwnProperty
propertyIsEnumerable
isPrototypeOf
__defineGetter__
__defineSetter__
__lookupGetter__
__lookupSetter__
__proto__
-----------------------------------------------------
-----------------------------------------------------
EXPRESSION: document.getElementById('my-select').options
type: object
subtype: array
description: HTMLOptionsCollection
OWN PROPERTIES:
0
__proto__
DISPLAYABLE PROPERTIES:
0
length
[WebIDL] Remove custom bindings for HTMLInputElement, HTMLFrameElement, HTMLMediaElement and HTMLOptionsCollection https://bugs.webkit.org/show_bug.cgi?id=167039 Patch by Sam Weinig <sam@webkit.org> on 2017-01-15 Reviewed by Darin Adler. Source/WebCore: * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSBindingsAllInOne.cpp: * bindings/js/JSHTMLFrameElementCustom.cpp: Removed. * bindings/js/JSHTMLInputElementCustom.cpp: Removed. * bindings/js/JSHTMLMediaElementCustom.cpp: Removed. Remove files. * html/HTMLOptionsCollection.idl: * bindings/js/JSHTMLOptionsCollectionCustom.cpp: (WebCore::JSHTMLOptionsCollection::setLength): Deleted. Remove custom setLength. The bindings generator can handle this now. * html/HTMLFrameElement.idl: Resort to match spec. Replace custom annotation for location with SetterCallWith=ScriptState. * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::setLocation): * html/HTMLFrameElementBase.h: Add implementation of setLocation. * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::selectionStartForBindings): (WebCore::HTMLInputElement::setSelectionStartForBindings): (WebCore::HTMLInputElement::selectionEndForBindings): (WebCore::HTMLInputElement::setSelectionEndForBindings): (WebCore::HTMLInputElement::selectionDirectionForBindings): (WebCore::HTMLInputElement::setSelectionDirectionForBindings): (WebCore::HTMLInputElement::setSelectionRangeForBindings): * html/HTMLInputElement.h: * html/HTMLInputElement.idl: Add variants of the selection properties that throw using the 'forBindings' suffix to differentiate. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::setControllerForBindings): * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::controllerForBindings): * html/HTMLMediaElement.idl: Add a variant of the controller property that unsets the media group, using the 'forBindings' suffix to differentiate. * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::setLength): Match other implementations by ignoring attempts to set large lengths (> 10000) rather than clamping. LayoutTests: * fast/dom/HTMLSelectElement/select-selectedIndex-expected.txt: * fast/dom/HTMLSelectElement/select-selectedIndex-multiple-expected.txt: * fast/dom/HTMLSelectElement/select-selectedIndex-multiple.html: * fast/dom/HTMLSelectElement/select-selectedIndex.html: Update tests / results now that negative lengths don't throw, but do log due to be converted to a large number. * fast/forms/select-max-length-expected.txt: Update result now that a large length is not clamped, but rather, ignored. Canonical link: https://commits.webkit.org/184153@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-15 20:05:20 +00:00
selectedIndex
__proto__
ALL PROPERTIES:
0
constructor
length
[WebIDL] Remove custom bindings for HTMLInputElement, HTMLFrameElement, HTMLMediaElement and HTMLOptionsCollection https://bugs.webkit.org/show_bug.cgi?id=167039 Patch by Sam Weinig <sam@webkit.org> on 2017-01-15 Reviewed by Darin Adler. Source/WebCore: * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSBindingsAllInOne.cpp: * bindings/js/JSHTMLFrameElementCustom.cpp: Removed. * bindings/js/JSHTMLInputElementCustom.cpp: Removed. * bindings/js/JSHTMLMediaElementCustom.cpp: Removed. Remove files. * html/HTMLOptionsCollection.idl: * bindings/js/JSHTMLOptionsCollectionCustom.cpp: (WebCore::JSHTMLOptionsCollection::setLength): Deleted. Remove custom setLength. The bindings generator can handle this now. * html/HTMLFrameElement.idl: Resort to match spec. Replace custom annotation for location with SetterCallWith=ScriptState. * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::setLocation): * html/HTMLFrameElementBase.h: Add implementation of setLocation. * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::selectionStartForBindings): (WebCore::HTMLInputElement::setSelectionStartForBindings): (WebCore::HTMLInputElement::selectionEndForBindings): (WebCore::HTMLInputElement::setSelectionEndForBindings): (WebCore::HTMLInputElement::selectionDirectionForBindings): (WebCore::HTMLInputElement::setSelectionDirectionForBindings): (WebCore::HTMLInputElement::setSelectionRangeForBindings): * html/HTMLInputElement.h: * html/HTMLInputElement.idl: Add variants of the selection properties that throw using the 'forBindings' suffix to differentiate. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::setControllerForBindings): * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::controllerForBindings): * html/HTMLMediaElement.idl: Add a variant of the controller property that unsets the media group, using the 'forBindings' suffix to differentiate. * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::setLength): Match other implementations by ignoring attempts to set large lengths (> 10000) rather than clamping. LayoutTests: * fast/dom/HTMLSelectElement/select-selectedIndex-expected.txt: * fast/dom/HTMLSelectElement/select-selectedIndex-multiple-expected.txt: * fast/dom/HTMLSelectElement/select-selectedIndex-multiple.html: * fast/dom/HTMLSelectElement/select-selectedIndex.html: Update tests / results now that negative lengths don't throw, but do log due to be converted to a large number. * fast/forms/select-max-length-expected.txt: Update result now that a large length is not clamped, but rather, ignored. Canonical link: https://commits.webkit.org/184153@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-15 20:05:20 +00:00
selectedIndex
add
remove
[WebIDL] Remove custom bindings for HTMLInputElement, HTMLFrameElement, HTMLMediaElement and HTMLOptionsCollection https://bugs.webkit.org/show_bug.cgi?id=167039 Patch by Sam Weinig <sam@webkit.org> on 2017-01-15 Reviewed by Darin Adler. Source/WebCore: * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSBindingsAllInOne.cpp: * bindings/js/JSHTMLFrameElementCustom.cpp: Removed. * bindings/js/JSHTMLInputElementCustom.cpp: Removed. * bindings/js/JSHTMLMediaElementCustom.cpp: Removed. Remove files. * html/HTMLOptionsCollection.idl: * bindings/js/JSHTMLOptionsCollectionCustom.cpp: (WebCore::JSHTMLOptionsCollection::setLength): Deleted. Remove custom setLength. The bindings generator can handle this now. * html/HTMLFrameElement.idl: Resort to match spec. Replace custom annotation for location with SetterCallWith=ScriptState. * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::setLocation): * html/HTMLFrameElementBase.h: Add implementation of setLocation. * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::selectionStartForBindings): (WebCore::HTMLInputElement::setSelectionStartForBindings): (WebCore::HTMLInputElement::selectionEndForBindings): (WebCore::HTMLInputElement::setSelectionEndForBindings): (WebCore::HTMLInputElement::selectionDirectionForBindings): (WebCore::HTMLInputElement::setSelectionDirectionForBindings): (WebCore::HTMLInputElement::setSelectionRangeForBindings): * html/HTMLInputElement.h: * html/HTMLInputElement.idl: Add variants of the selection properties that throw using the 'forBindings' suffix to differentiate. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::setControllerForBindings): * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::controllerForBindings): * html/HTMLMediaElement.idl: Add a variant of the controller property that unsets the media group, using the 'forBindings' suffix to differentiate. * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::setLength): Match other implementations by ignoring attempts to set large lengths (> 10000) rather than clamping. LayoutTests: * fast/dom/HTMLSelectElement/select-selectedIndex-expected.txt: * fast/dom/HTMLSelectElement/select-selectedIndex-multiple-expected.txt: * fast/dom/HTMLSelectElement/select-selectedIndex-multiple.html: * fast/dom/HTMLSelectElement/select-selectedIndex.html: Update tests / results now that negative lengths don't throw, but do log due to be converted to a large number. * fast/forms/select-max-length-expected.txt: Update result now that a large length is not clamped, but rather, ignored. Canonical link: https://commits.webkit.org/184153@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-15 20:05:20 +00:00
item
namedItem
JavaScript for-of does not work on a lot of collection types (e.g. HTMLCollection) https://bugs.webkit.org/show_bug.cgi?id=167091 Reviewed by Darin Adler. Source/JavaScriptCore: Update Array methods to throw a TypeError when (this === null || this === undefined) instead of when (this == null). This is because (this == null) returns true for types that masquerades as undefined (such as document.all) and this prevented use of the Array API on such types. The specification only stays to use ToObject(), which throws when the input is undefined or null. The corresponding specification is at: - https://www.ecma-international.org/ecma-262/7.0/index.html#sec-array.prototype.values - https://www.ecma-international.org/ecma-262/7.0/index.html#sec-toobject * builtins/ArrayPrototype.js: (values): (keys): (entries): (reduce): (reduceRight): (every): (forEach): (filter): (map): (some): (fill): (find): (findIndex): (includes): (sort): (concatSlowPath): (copyWithin): Source/WebCore: As per the Web IDL specification [1], https://heycam.github.io/webidl/#es-iterator an interface should get an iterator if it has: - an indexed property getter and an integer-typed attribute named "length". We now comply with this part of the Web IDL specification. This adds an iterator to the following interfaces: - AudioTrackList, ClientRectList, CSSRuleList, CSSStyleDeclaration, CSSValueList, MimeTypeArray, WebKitNamedFlowCollection, Plugin, PluginArray, DOMStringList, FileList, HTMLAllCollection, HTMLCollection, HTMLFormElement, HTMLOptionsCollection, HTMLSelectElement, MediaList, NamedNodeMap, SourceBufferList, StyleSheetList, TextTrackCueList, TextTrackList, TouchList, VideoTrackList, VTTRegionList. As a result, it is now possible to use `for ... of` for those types. Tests: fast/dom/FileList-iterator.html fast/dom/collection-iterators.html fast/dom/document-all-undefined.html fast/events/touch/ios/touchlist-iterator.html * bindings/scripts/CodeGeneratorJS.pm: (GetAttributeWithName): (InterfaceNeedsIterator): (GenerateImplementation): (addIterableProperties): LayoutTests: * fast/dom/FileList-iterator-expected.txt: Added. * fast/dom/FileList-iterator.html: Added. * fast/dom/collection-iterators-expected.txt: Added. * fast/dom/collection-iterators.html: Added. * fast/events/touch/ios/touchlist-iterator-expected.txt: Added. * fast/events/touch/ios/touchlist-iterator.html: Added. Add layout test coverage for all types that gained an iterator. * fast/dom/document-all-undefined-expected.txt: Added. * fast/dom/document-all-undefined.html: Added. Add layout test to cover the fact that HTMLAllCollection masquerades as undefined, as per: - https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-all * inspector/model/remote-object-get-properties-expected.txt: Rebaseline now that there is an extra Symbol.iterator property. * platform/wk2/TestExpectations: Skip that requires beginDragWithFiles() as this is unimplemented in WebKitTestRunner. Canonical link: https://commits.webkit.org/184338@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211024 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-22 05:48:28 +00:00
Symbol(Symbol.iterator)
[WebIDL] Interface prototype objects should define @@toStringTag https://bugs.webkit.org/show_bug.cgi?id=211020 Reviewed by Darin Adler. LayoutTests/imported/w3c: Adjust tests for `X.prototype.toString()` returning "[object X]" instead of "[object XPrototype]", where X is WebIDL interface. * web-platform-tests/WebIDL/ecmascript-binding/class-string-interface.any-expected.txt: * web-platform-tests/WebIDL/ecmascript-binding/class-string-interface.any.worker-expected.txt: * web-platform-tests/WebIDL/ecmascript-binding/class-string-named-properties-object.window-expected.txt: * web-platform-tests/dom/nodes/Document-createEvent.https-expected.txt: * web-platform-tests/html/browsers/the-window-object/window-prototype-chain.html: WPT revision: 50417942bbfe. * web-platform-tests/wasm/jsapi/instance/toString.any-expected.txt: * web-platform-tests/wasm/jsapi/instance/toString.any.worker-expected.txt: * web-platform-tests/wasm/jsapi/memory/toString.any-expected.txt: * web-platform-tests/wasm/jsapi/memory/toString.any.worker-expected.txt: * web-platform-tests/wasm/jsapi/module/toString.any-expected.txt: * web-platform-tests/wasm/jsapi/module/toString.any.worker-expected.txt: * web-platform-tests/wasm/jsapi/table/toString.any-expected.txt: * web-platform-tests/wasm/jsapi/table/toString.any.worker-expected.txt: Source/JavaScriptCore: WebIDL spec was recently updated [1] to define @@toStringTag on interface prototype objects. This change aligns WebIDL with ECMA-262 built-ins and Blink's behavior. Gecko have also expressed implementation commitment. This patch implements the spec change, making `X.prototype.toString()` return "[object X]" instead of "[object XPrototype]", where X is WebIDL interface. This behavior is proven to be web compatible (shipping in Chrome since Q2 2016) and matches class strings of iterator prototype objects [2] introduced in r253855. We define @@toStringTag for all WebAssembly interfaces but Error subclasses since they are not defined using WebIDL [3]. This change also introduces JSC_TO_STRING_TAG_WITHOUT_TRANSITION() macro that sets up @@toStringTag using ClassInfo to avoid extra strings creation, ensuring `className` equality between prototype and instance classes (fixing a few discrepancies), as well as correct descriptors. It also ensures using faster jsNontrivialString() and relieves from putting more code into CodeGeneratorJS.pm. [1]: https://github.com/heycam/webidl/pull/357 [2]: https://heycam.github.io/webidl/#es-iterator-prototype-object [3]: https://webassembly.github.io/spec/js-api/#error-objects Tests: imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.js imported/w3c/web-platform-tests/wasm/jsapi/memory/toString.any.js imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.js imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.js * runtime/ArrayIteratorPrototype.cpp: (JSC::ArrayIteratorPrototype::finishCreation): * runtime/AsyncFunctionPrototype.cpp: (JSC::AsyncFunctionPrototype::finishCreation): * runtime/AsyncGeneratorFunctionPrototype.cpp: (JSC::AsyncGeneratorFunctionPrototype::finishCreation): * runtime/AsyncGeneratorPrototype.cpp: (JSC::AsyncGeneratorPrototype::finishCreation): * runtime/BigIntPrototype.cpp: (JSC::BigIntPrototype::finishCreation): * runtime/GeneratorFunctionPrototype.cpp: (JSC::GeneratorFunctionPrototype::finishCreation): * runtime/GeneratorPrototype.cpp: (JSC::GeneratorPrototype::finishCreation): * runtime/IntlCollatorPrototype.cpp: (JSC::IntlCollatorPrototype::finishCreation): * runtime/IntlDateTimeFormatPrototype.cpp: (JSC::IntlDateTimeFormatPrototype::finishCreation): * runtime/IntlNumberFormatPrototype.cpp: (JSC::IntlNumberFormatPrototype::finishCreation): * runtime/IntlPluralRulesPrototype.cpp: (JSC::IntlPluralRulesPrototype::finishCreation): * runtime/IntlRelativeTimeFormatPrototype.cpp: (JSC::IntlRelativeTimeFormatPrototype::finishCreation): * runtime/JSArrayBufferPrototype.cpp: (JSC::JSArrayBufferPrototype::finishCreation): * runtime/JSDataViewPrototype.cpp: (JSC::JSDataViewPrototype::finishCreation): * runtime/JSONObject.cpp: (JSC::JSONObject::finishCreation): * runtime/JSObject.h: * runtime/JSPromisePrototype.cpp: (JSC::JSPromisePrototype::finishCreation): * runtime/MapIteratorPrototype.cpp: (JSC::MapIteratorPrototype::finishCreation): * runtime/MapPrototype.cpp: (JSC::MapPrototype::finishCreation): * runtime/MathObject.cpp: (JSC::MathObject::finishCreation): * runtime/RegExpStringIteratorPrototype.cpp: (JSC::RegExpStringIteratorPrototype::finishCreation): * runtime/SetIteratorPrototype.cpp: (JSC::SetIteratorPrototype::finishCreation): * runtime/SetPrototype.cpp: (JSC::SetPrototype::finishCreation): * runtime/StringIteratorPrototype.cpp: (JSC::StringIteratorPrototype::finishCreation): * runtime/SymbolPrototype.cpp: (JSC::SymbolPrototype::finishCreation): * runtime/WeakMapPrototype.cpp: (JSC::WeakMapPrototype::finishCreation): * runtime/WeakObjectRefPrototype.cpp: (JSC::WeakObjectRefPrototype::finishCreation): * runtime/WeakSetPrototype.cpp: (JSC::WeakSetPrototype::finishCreation): * wasm/js/WebAssemblyInstancePrototype.cpp: (JSC::WebAssemblyInstancePrototype::finishCreation): * wasm/js/WebAssemblyMemoryPrototype.cpp: (JSC::WebAssemblyMemoryPrototype::finishCreation): * wasm/js/WebAssemblyModulePrototype.cpp: (JSC::WebAssemblyModulePrototype::finishCreation): * wasm/js/WebAssemblyTablePrototype.cpp: (JSC::WebAssemblyTablePrototype::finishCreation): Source/WebCore: WebIDL spec was recently updated [1] to define @@toStringTag on interface prototype objects. This change aligns WebIDL with ECMA-262 built-ins and Blink's behavior. Gecko have also expressed implementation commitment. This patch implements the spec change, making `X.prototype.toString()` return "[object X]" instead of "[object XPrototype]", where X is WebIDL interface. This behavior is proven to be web compatible (shipping in Chrome since Q2 2016) and matches class strings of iterator prototype objects [2] introduced in r253855. [1]: https://github.com/heycam/webidl/pull/357 [2]: https://heycam.github.io/webidl/#es-iterator-prototype-object Tests: fast/dom/prototype-chain.html fast/dom/wrapper-classes.html fast/workers/DedicatedWorkerGlobalScope-prototype-chain.html imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/class-string-interface.any.js imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/class-string-named-properties-object.window.js * bindings/js/JSDOMIterator.h: (WebCore::IteratorTraits>::finishCreation): * bindings/js/JSDOMWindowProperties.cpp: (WebCore::JSDOMWindowProperties::finishCreation): * bindings/js/JSDOMWindowProperties.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): (GeneratePrototypeDeclaration): (GenerateConstructorHelperMethods): * bindings/scripts/test/*: Updated. LayoutTests: Adjust tests for `X.prototype.toString()` returning "[object X]" instead of "[object XPrototype]", where X is WebIDL interface. * css3/blending/background-blend-mode-property-parsing-expected.txt: * css3/blending/background-blend-mode-property-parsing.html: * css3/blending/blend-mode-property-parsing-expected.txt: * css3/blending/blend-mode-property-parsing.html: * css3/filters/backdrop/backdropfilter-property-parsing-expected.txt: * css3/filters/backdrop/backdropfilter-property-parsing.html: * css3/filters/filter-property-parsing-expected.txt: * css3/filters/filter-property-parsing.html: * fast/css/image-set-parsing-expected.txt: * fast/css/image-set-parsing-generated-expected.txt: * fast/css/image-set-parsing-generated.html: * fast/css/image-set-parsing.html: * fast/dom/DOMException/prototype-object-expected.txt: * fast/dom/DOMException/prototype-object.html: * fast/dom/prototype-chain-expected.txt: * fast/dom/wrapper-classes-expected.txt: * fast/dom/wrapper-classes.html: * fast/events/event-view-toString-expected.txt: * fast/workers/DedicatedWorkerGlobalScope-prototype-chain-expected.txt: * fast/workers/DedicatedWorkerGlobalScope-prototype-chain.html: * http/tests/xmlhttprequest/XMLHttpRequestException-expected.txt: * inspector/model/remote-object-get-properties-expected.txt: * platform/gtk/imported/w3c/web-platform-tests/dom/nodes/Document-createEvent.https-expected.txt: * platform/ios-wk2/imported/w3c/web-platform-tests/dom/nodes/Document-createEvent.https-expected.txt: * platform/wpe/imported/w3c/web-platform-tests/dom/nodes/Document-createEvent.https-expected.txt: * resources/idlharness.js: Remove asserts that are commented out in upstream. * svg/dom/svg2-inheritance.html: * transforms/2d/transform-value-types-expected.txt: * transforms/2d/transform-value-types.html: Canonical link: https://commits.webkit.org/224174@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260992 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-01 09:48:33 +00:00
Symbol(Symbol.toStringTag)
toString
toLocaleString
valueOf
hasOwnProperty
propertyIsEnumerable
isPrototypeOf
__defineGetter__
__defineSetter__
__lookupGetter__
__lookupSetter__
__proto__
-----------------------------------------------------
Web Inspector: Expanding event objects in console shows undefined for most values, it should have real values https://bugs.webkit.org/show_bug.cgi?id=137306 Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-01-20 Reviewed by Timothy Hatcher. Source/JavaScriptCore: Provide another optional parameter to getProperties, to gather a list of all own and getter properties. * inspector/InjectedScript.cpp: (Inspector::InjectedScript::getProperties): * inspector/InjectedScript.h: * inspector/InjectedScriptSource.js: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getProperties): * inspector/agents/InspectorRuntimeAgent.h: * inspector/protocol/Runtime.json: Source/WebInspectorUI: When first expanding an object, show all the object's own properties and any getter properties that may be on its prototype chain. Now, we only fetch own properties, for __proto__ properties. * UserInterface/Protocol/RemoteObject.js: (WebInspector.RemoteObject.prototype.getOwnProperties): (WebInspector.RemoteObject.prototype.getOwnAndGetterProperties): (WebInspector.RemoteObject.prototype.getAllProperties): (WebInspector.RemoteObject.prototype.get hasChildren): Deleted. * UserInterface/Views/ObjectPropertiesSection.js: (WebInspector.ObjectPropertiesSection): (WebInspector.ObjectPropertiesSection.prototype.update): (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate): LayoutTests: * inspector/model/remote-object-get-properties-expected.txt: Added. * inspector/model/remote-object-get-properties.html: Added. Canonical link: https://commits.webkit.org/158679@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178768 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-01-21 00:34:57 +00:00
DONE