Changeset 95877 in webkit
- Timestamp:
- Sep 23, 2011 3:59:18 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r95874 r95877 1 gh@apple.com> 2 3 Strict mode does not work in non-trivial nested functions. 4 https://bugs.webkit.org/show_bug.cgi?id=68740 5 6 Reviewed by Oliver Hunt. 7 8 Function-info caching does not preserve all state that it should. 9 10 * fast/js/nested-functions-expected.txt: Added. 11 * fast/js/nested-functions.html: Added. 12 * fast/js/script-tests/nested-functions.js: Added. 13 (runTests.test1): 14 (runTests.test2): 15 (runTests.test3): 16 (runTests): 17 1 18 2011-09-23 Dan Bernstein <mitz@apple.com> 2 19 -
trunk/Source/JavaScriptCore/ChangeLog
r95876 r95877 1 2011-09-23 Gavin Barraclough <barraclough@apple.com> 2 3 Strict mode does not work in non-trivial nested functions. 4 https://bugs.webkit.org/show_bug.cgi?id=68740 5 6 Reviewed by Oliver Hunt. 7 8 Function-info caching does not preserve all state that it should. 9 10 * parser/JSParser.cpp: 11 (JSC::JSParser::Scope::saveFunctionInfo): 12 (JSC::JSParser::Scope::restoreFunctionInfo): 13 (JSC::JSParser::parseFunctionInfo): 14 * parser/SourceProviderCacheItem.h: 15 1 16 2011-09-23 Filip Pizlo <fpizlo@apple.com> 2 17 -
trunk/Source/JavaScriptCore/parser/JSParser.cpp
r90535 r95877 753 753 ASSERT(m_isFunction); 754 754 info->usesEval = m_usesEval; 755 info->strictMode = m_strictMode; 756 info->needsFullActivation = m_needsFullActivation; 755 757 copyCapturedVariablesToVector(m_writtenVariables, info->writtenVariables); 756 758 copyCapturedVariablesToVector(m_usedVariables, info->usedVariables); … … 761 763 ASSERT(m_isFunction); 762 764 m_usesEval = info->usesEval; 765 m_strictMode = info->strictMode; 766 m_needsFullActivation = info->needsFullActivation; 763 767 unsigned size = info->usedVariables.size(); 764 768 for (unsigned i = 0; i < size; ++i) … … 1609 1613 bodyStartLine = tokenLine(); 1610 1614 1615 // If we know about this function already, we can use the cached info and skip the parser to the end of the function. 1611 1616 if (const SourceProviderCacheItem* cachedInfo = TreeBuilder::CanUseFunctionCache ? findCachedFunctionInfo(openBracePos) : 0) { 1612 // If we know about this function already, we can use the cached info and skip the parser to the end of the function. 1613 body = context.createFunctionBody(strictMode()); 1617 // If we're in a strict context, the cached function info must say it was strict too. 1618 ASSERT(!strictMode() || cachedInfo->strictMode); 1619 body = context.createFunctionBody(cachedInfo->strictMode); 1614 1620 1615 1621 functionScope->restoreFunctionInfo(cachedInfo); -
trunk/Source/JavaScriptCore/parser/SourceProviderCacheItem.h
r76611 r95877 60 60 int closeBracePos; 61 61 bool usesEval; 62 bool strictMode; 63 bool needsFullActivation; 62 64 Vector<RefPtr<StringImpl> > usedVariables; 63 65 Vector<RefPtr<StringImpl> > writtenVariables;
Note: See TracChangeset
for help on using the changeset viewer.