Changeset 26621 in webkit for trunk/JavaScriptCore
- Timestamp:
- Oct 15, 2007, 1:44:09 PM (18 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r26620 r26621 1 2007-10-15 Geoffrey Garen <[email protected]> 2 3 Reviewed by Darin Adler. 4 5 Removed surprising self-named "hack" that made nested functions 6 available as named properties of their containing functions, and placed 7 containing function objects in the scope chains of nested functions. 8 9 There were a few reasons to remove this "hack:" 10 11 1. It contradicted FF, IE, and the ECMA spec. 12 13 2. It incurred a performance penalty, since merely parsing a function 14 required parsing its body for nested functions (and so on). 15 16 3. SVN history contains no explanation for why it was added. It was just 17 legacy code in a large merge a long, long time ago. 18 19 [ Patch broken off from http://bugs.webkit.org/show_bug.cgi?id=14868 ] 20 21 * kjs/nodes.cpp: 22 (FuncDeclNode::processFuncDecl): 23 1 24 2007-10-15 Geoffrey Garen <[email protected]> 2 25 -
trunk/JavaScriptCore/kjs/nodes.cpp
r26620 r26621 2487 2487 // ECMA 10.2.2 2488 2488 context->variableObject()->put(exec, ident, func, Internal | (context->codeType() == EvalCode ? 0 : DontDelete)); 2489 2490 if (body) {2491 // hack the scope so that the function gets put as a property of func, and it's scope2492 // contains the func as well as our current scope2493 JSObject *oldVar = context->variableObject();2494 context->setVariableObject(func);2495 context->pushScope(func);2496 body->processFuncDecl(exec);2497 context->popScope();2498 context->setVariableObject(oldVar);2499 }2500 2489 } 2501 2490
Note:
See TracChangeset
for help on using the changeset viewer.