Changeset 37859 in webkit for trunk/JavaScriptCore/kjs
- Timestamp:
- Oct 24, 2008, 1:44:58 PM (17 years ago)
- Location:
- trunk/JavaScriptCore/kjs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/JSFunction.cpp
r37845 r37859 103 103 bool JSFunction::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 104 104 { 105 if (propertyName == exec->propertyNames().prototype) { 106 JSValue** location = getDirectLocation(propertyName); 107 108 if (!location) { 109 JSObject* prototype = new (exec) JSObject(m_scopeChain.globalObject()->emptyObjectStructure()); 110 prototype->putDirect(exec->propertyNames().constructor, this, DontEnum); 111 putDirect(exec->propertyNames().prototype, prototype, DontDelete); 112 location = getDirectLocation(propertyName); 113 } 114 115 slot.setValueSlot(this, location, offsetForLocation(location)); 116 } 117 105 118 if (propertyName == exec->propertyNames().arguments) { 106 119 slot.setCustom(this, argumentsGetter); -
trunk/JavaScriptCore/kjs/nodes.cpp
r37763 r37859 1872 1872 JSFunction* FuncDeclNode::makeFunction(ExecState* exec, ScopeChainNode* scopeChain) 1873 1873 { 1874 return new (exec) JSFunction(exec, m_ident, m_body.get(), scopeChain); 1875 } 1876 1877 RegisterID* FuncDeclNode::emitCode(CodeGenerator&, RegisterID* dst) 1878 { 1879 return dst; 1880 } 1881 1882 // ------------------------------ FuncExprNode --------------------------------- 1883 1884 RegisterID* FuncExprNode::emitCode(CodeGenerator& generator, RegisterID* dst) 1885 { 1886 return generator.emitNewFunctionExpression(generator.finalDestination(dst), this); 1887 } 1888 1889 JSFunction* FuncExprNode::makeFunction(ExecState* exec, ScopeChainNode* scopeChain) 1890 { 1874 1891 JSFunction* func = new (exec) JSFunction(exec, m_ident, m_body.get(), scopeChain); 1875 1876 JSObject* proto = constructEmptyObject(exec);1877 proto->putDirect(exec->propertyNames().constructor, func, DontEnum);1878 func->putDirect(exec->propertyNames().prototype, proto, DontDelete);1879 return func;1880 }1881 1882 RegisterID* FuncDeclNode::emitCode(CodeGenerator&, RegisterID* dst)1883 {1884 return dst;1885 }1886 1887 // ------------------------------ FuncExprNode ---------------------------------1888 1889 RegisterID* FuncExprNode::emitCode(CodeGenerator& generator, RegisterID* dst)1890 {1891 return generator.emitNewFunctionExpression(generator.finalDestination(dst), this);1892 }1893 1894 JSFunction* FuncExprNode::makeFunction(ExecState* exec, ScopeChainNode* scopeChain)1895 {1896 JSFunction* func = new (exec) JSFunction(exec, m_ident, m_body.get(), scopeChain);1897 JSObject* proto = constructEmptyObject(exec);1898 proto->putDirect(exec->propertyNames().constructor, func, DontEnum);1899 func->putDirect(exec->propertyNames().prototype, proto, DontDelete);1900 1892 1901 1893 /*
Note:
See TracChangeset
for help on using the changeset viewer.