Changeset 196243 in webkit
- Timestamp:
- Feb 7, 2016 3:16:20 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r196242 r196243 1 2016-02-07 Saam barati <sbarati@apple.com> 2 3 [ES6] bound functions .name property should be "bound " + the target function's name 4 https://bugs.webkit.org/show_bug.cgi?id=153796 5 6 Reviewed by Darin Adler. 7 8 * js/bound-function-name-expected.txt: Added. 9 * js/bound-function-name.html: Added. 10 * js/script-tests/bound-function-name.js: Added. 11 (assert): 12 (assert.foo): 13 (bar): 14 1 15 2016-02-07 Daniel Bates <dabates@apple.com> 2 16 -
trunk/Source/JavaScriptCore/ChangeLog
r196240 r196243 1 2016-02-07 Saam barati <sbarati@apple.com> 2 3 Follow up patch to: [ES6] bound functions .name property should be "bound " + the target function's name 4 https://bugs.webkit.org/show_bug.cgi?id=153796 5 6 Reviewed by Darin Adler. 7 8 This follow-up patch addresses some comments/suggestions by 9 Ryosuke, Darin, and Joe. It simplifies JSBoundFunction::toStringName 10 and adds some tests for bound names. 11 12 * runtime/JSBoundFunction.cpp: 13 (JSC::hasInstanceBoundFunction): 14 (JSC::JSBoundFunction::create): 15 (JSC::JSBoundFunction::toStringName): 16 1 17 2016-02-07 Filip Pizlo <fpizlo@apple.com> 2 18 -
trunk/Source/JavaScriptCore/runtime/JSBoundFunction.cpp
r196033 r196243 88 88 } 89 89 90 static const char* const boundPrefix = "bound ";91 92 90 JSBoundFunction* JSBoundFunction::create(VM& vm, JSGlobalObject* globalObject, JSObject* targetFunction, JSValue boundThis, JSValue boundArgs, int length, const String& name) 93 91 { … … 98 96 JSBoundFunction* function = new (NotNull, allocateCell<JSBoundFunction>(vm.heap)) JSBoundFunction(vm, globalObject, globalObject->boundFunctionStructure(), targetFunction, boundThis, boundArgs); 99 97 100 function->finishCreation(vm, executable, length, makeString( ASCIILiteral(boundPrefix), name));98 function->finishCreation(vm, executable, length, makeString("bound ", name)); 101 99 return function; 102 100 } … … 137 135 String JSBoundFunction::toStringName(ExecState* exec) 138 136 { 139 String result = name(exec); 140 ASSERT(result.find(ASCIILiteral(boundPrefix)) == 0); 141 static const size_t boundPrefixLength = 6; 142 return result.substring(boundPrefixLength); 137 return m_targetFunction->get(exec, exec->vm().propertyNames->name).toWTFString(exec); 143 138 } 144 139
Note: See TracChangeset
for help on using the changeset viewer.