Keep only captured symbols in CodeBlock symbol tables.
[WebKit-https.git] / Source / JavaScriptCore / bytecompiler / BytecodeGenerator.cpp
index 291f8e731c18d6b290fa56a831dc55de3ffb2314..708081c72fa04f7025b11bfdc5768dae4699ccb8 100644 (file)
@@ -115,6 +115,9 @@ ParserError BytecodeGenerator::generate()
 
     m_codeBlock->shrinkToFit();
 
+    if (m_codeBlock->symbolTable())
+        m_codeBlock->setSymbolTable(m_codeBlock->symbolTable()->cloneCapturedNames(*m_codeBlock->vm()));
+
     if (m_expressionTooDeep)
         return ParserError(ParserError::OutOfMemory);
     return ParserError(ParserError::ErrorNone);