Changeset 189522 in webkit
- Timestamp:
- Sep 8, 2015 6:01:06 PM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r189520 r189522 1 2015-09-08 Matthew Hill <matthew.jh@outlook.com> 2 3 Function.prototype.bind: Bound functions must use the [[Prototype]] of their target function instead of Function.prototype 4 https://bugs.webkit.org/show_bug.cgi?id=145605 5 6 Reviewed by Geoffrey Garen. 7 8 * runtime/JSBoundFunction.cpp: 9 (JSC::JSBoundFunction::create): 10 * tests/es6.yaml: 11 1 12 2015-09-08 Mark Lam <mark.lam@apple.com> 2 13 -
trunk/Source/JavaScriptCore/runtime/JSBoundFunction.cpp
r182899 r189522 36 36 37 37 EncodedJSValue JSC_HOST_CALL boundFunctionCall(ExecState* exec) 38 { 38 { 39 39 JSBoundFunction* boundFunction = jsCast<JSBoundFunction*>(exec->callee()); 40 40 … … 81 81 bool canConstruct = constructType != ConstructTypeNone; 82 82 NativeExecutable* executable = vm.getHostFunction(boundFunctionCall, canConstruct ? boundFunctionConstruct : callHostFunctionAsConstructor); 83 JSBoundFunction* function = new (NotNull, allocateCell<JSBoundFunction>(vm.heap)) JSBoundFunction(vm, globalObject, globalObject->boundFunctionStructure(), targetFunction, boundThis, boundArgs); 84 83 JSValue targetPrototype = targetFunction->prototype(); 84 Structure* structure = JSBoundFunction::createStructure(vm, globalObject, targetPrototype); 85 JSBoundFunction* function = new (NotNull, allocateCell<JSBoundFunction>(vm.heap)) JSBoundFunction(vm, globalObject, structure, targetFunction, boundThis, boundArgs); 86 85 87 function->finishCreation(vm, executable, length, name); 86 88 return function; -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r189429 r189522 272 272 m_functionStructure.set(vm, this, JSFunction::createStructure(vm, this, m_functionPrototype.get())); 273 273 m_arrowFunctionStructure.set(vm, this, JSArrowFunction::createStructure(vm, this, m_functionPrototype.get())); 274 m_boundFunctionStructure.set(vm, this, JSBoundFunction::createStructure(vm, this, m_functionPrototype.get()));275 274 m_nativeStdFunctionStructure.set(vm, this, JSNativeStdFunction::createStructure(vm, this, m_functionPrototype.get())); 276 275 m_namedFunctionStructure.set(vm, this, Structure::addPropertyTransition(vm, m_functionStructure.get(), vm.propertyNames->name, DontDelete | ReadOnly | DontEnum, m_functionNameOffset)); … … 819 818 visitor.append(&thisObject->m_calleeStructure); 820 819 visitor.append(&thisObject->m_functionStructure); 821 visitor.append(&thisObject->m_boundFunctionStructure);822 820 visitor.append(&thisObject->m_arrowFunctionStructure); 823 821 visitor.append(&thisObject->m_nativeStdFunctionStructure); -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h
r189429 r189522 256 256 WriteBarrier<Structure> m_calleeStructure; 257 257 WriteBarrier<Structure> m_functionStructure; 258 WriteBarrier<Structure> m_boundFunctionStructure;259 258 WriteBarrier<Structure> m_arrowFunctionStructure; 260 259 WriteBarrier<Structure> m_nativeStdFunctionStructure; … … 491 490 Structure* calleeStructure() const { return m_calleeStructure.get(); } 492 491 Structure* functionStructure() const { return m_functionStructure.get(); } 493 Structure* boundFunctionStructure() const { return m_boundFunctionStructure.get(); }494 492 Structure* arrowFunctionStructure() const { return m_arrowFunctionStructure.get(); } 495 493 Structure* nativeStdFunctionStructure() const { return m_nativeStdFunctionStructure.get(); } -
trunk/Source/JavaScriptCore/tests/es6.yaml
r189504 r189522 882 882 cmd: runES6 :fail 883 883 - path: es6/prototype_of_bound_functions_arrow_functions.js 884 cmd: runES6 : fail884 cmd: runES6 :normal 885 885 - path: es6/prototype_of_bound_functions_basic_functions.js 886 cmd: runES6 : fail886 cmd: runES6 :normal 887 887 - path: es6/prototype_of_bound_functions_classes.js 888 cmd: runES6 : fail888 cmd: runES6 :normal 889 889 - path: es6/prototype_of_bound_functions_generator_functions.js 890 890 cmd: runES6 :fail 891 891 - path: es6/prototype_of_bound_functions_subclasses.js 892 cmd: runES6 : fail892 cmd: runES6 :normal 893 893 - path: es6/Proxy_apply_handler.js 894 894 cmd: runES6 :fail
Note: See TracChangeset
for help on using the changeset viewer.