<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[188463] releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/188463">188463</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2015-08-14 04:46:08 -0700 (Fri, 14 Aug 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/188417">r188417</a> - Unify JSParserCodeType, FunctionParseMode and ModuleParseMode into SourceParseMode
https://bugs.webkit.org/show_bug.cgi?id=147353
Reviewed by Saam Barati.
This is the follow-up patch after <a href="http://trac.webkit.org/projects/webkit/changeset/188355">r188355</a>.
It includes the following changes.
- Unify JSParserCodeType, FunctionParseMode and ModuleParseMode into SourceParseMode
- Make SourceParseMode to C++ strongly-typed enum.
- Fix the comments.
- Rename ModuleSpecifier to ModuleName.
- Add the type name `ImportEntry` before the C++11 uniform initialization.
- Fix the thrown message for duplicate 'default' names.
- Assert the all statements in the top-level source elements are the module declarations under the module analyzer phase.
* API/JSScriptRef.cpp:
(parseScript):
* builtins/BuiltinExecutables.cpp:
(JSC::BuiltinExecutables::createExecutableInternal):
* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::generateFunctionCodeBlock):
* bytecode/UnlinkedFunctionExecutable.h:
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::makeFunction):
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createFunctionMetadata):
(JSC::ASTBuilder::createModuleName):
(JSC::ASTBuilder::createImportDeclaration):
(JSC::ASTBuilder::createExportAllDeclaration):
(JSC::ASTBuilder::createExportNamedDeclaration):
(JSC::ASTBuilder::createModuleSpecifier): Deleted.
* parser/ModuleAnalyzer.cpp:
(JSC::ModuleAnalyzer::analyze):
* parser/NodeConstructors.h:
(JSC::ModuleNameNode::ModuleNameNode):
(JSC::ImportDeclarationNode::ImportDeclarationNode):
(JSC::ExportAllDeclarationNode::ExportAllDeclarationNode):
(JSC::ExportNamedDeclarationNode::ExportNamedDeclarationNode):
(JSC::ModuleSpecifierNode::ModuleSpecifierNode): Deleted.
* parser/Nodes.cpp:
(JSC::FunctionMetadataNode::FunctionMetadataNode):
* parser/Nodes.h:
(JSC::StatementNode::isModuleDeclarationNode):
(JSC::ModuleDeclarationNode::isModuleDeclarationNode):
(JSC::ImportDeclarationNode::moduleName):
(JSC::ExportAllDeclarationNode::moduleName):
(JSC::ExportNamedDeclarationNode::moduleName):
(JSC::ImportDeclarationNode::moduleSpecifier): Deleted.
(JSC::ExportAllDeclarationNode::moduleSpecifier): Deleted.
(JSC::ExportNamedDeclarationNode::moduleSpecifier): Deleted.
* parser/NodesAnalyzeModule.cpp:
(JSC::SourceElements::analyzeModule):
(JSC::ImportDeclarationNode::analyzeModule):
(JSC::ExportAllDeclarationNode::analyzeModule):
(JSC::ExportNamedDeclarationNode::analyzeModule):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::Parser):
(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::parseModuleSourceElements):
(JSC::Parser<LexerType>::parseFunctionBody):
(JSC::stringForFunctionMode):
(JSC::Parser<LexerType>::parseFunctionParameters):
(JSC::Parser<LexerType>::parseFunctionInfo):
(JSC::Parser<LexerType>::parseFunctionDeclaration):
(JSC::Parser<LexerType>::parseClass):
(JSC::Parser<LexerType>::parseModuleName):
(JSC::Parser<LexerType>::parseImportDeclaration):
(JSC::Parser<LexerType>::parseExportDeclaration):
(JSC::Parser<LexerType>::parsePropertyMethod):
(JSC::Parser<LexerType>::parseGetterSetter):
(JSC::Parser<LexerType>::parsePrimaryExpression):
(JSC::Parser<LexerType>::parseArrowFunctionExpression):
(JSC::Parser<LexerType>::parseModuleSpecifier): Deleted.
* parser/Parser.h:
(JSC::Parser<LexerType>::parse):
(JSC::parse):
* parser/ParserModes.h:
(JSC::isFunctionParseMode):
(JSC::isModuleParseMode):
(JSC::isProgramParseMode):
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::createFunctionMetadata):
(JSC::SyntaxChecker::createModuleName):
(JSC::SyntaxChecker::createImportDeclaration):
(JSC::SyntaxChecker::createExportAllDeclaration):
(JSC::SyntaxChecker::createExportNamedDeclaration):
(JSC::SyntaxChecker::createModuleSpecifier): Deleted.
* runtime/CodeCache.cpp:
(JSC::CodeCache::getGlobalCodeBlock):
(JSC::CodeCache::getFunctionExecutableFromGlobalCode):
* runtime/Completion.cpp:
(JSC::checkSyntax):
(JSC::checkModuleSyntax):
* runtime/Executable.cpp:
(JSC::ProgramExecutable::checkSyntax):
* tests/stress/modules-syntax-error-with-names.js:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit210SourceJavaScriptCoreAPIJSScriptRefcpp">releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/API/JSScriptRef.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceJavaScriptCoreChangeLog">releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceJavaScriptCorebuiltinsBuiltinExecutablescpp">releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceJavaScriptCorebytecodeUnlinkedFunctionExecutablecpp">releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceJavaScriptCorebytecodeUnlinkedFunctionExecutableh">releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceJavaScriptCorebytecompilerBytecodeGeneratorh">releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceJavaScriptCoreparserASTBuilderh">releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/ASTBuilder.h</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceJavaScriptCoreparserModuleAnalyzercpp">releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/ModuleAnalyzer.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceJavaScriptCoreparserNodeConstructorsh">releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/NodeConstructors.h</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceJavaScriptCoreparserNodescpp">releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/Nodes.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceJavaScriptCoreparserNodesh">releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/Nodes.h</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceJavaScriptCoreparserNodesAnalyzeModulecpp">releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/NodesAnalyzeModule.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceJavaScriptCoreparserParsercpp">releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/Parser.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceJavaScriptCoreparserParserh">releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/Parser.h</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceJavaScriptCoreparserParserModesh">releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/ParserModes.h</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceJavaScriptCoreparserSyntaxCheckerh">releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/SyntaxChecker.h</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceJavaScriptCoreruntimeCodeCachecpp">releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/runtime/CodeCache.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceJavaScriptCoreruntimeCompletioncpp">releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/runtime/Completion.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceJavaScriptCoreruntimeExecutablecpp">releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/runtime/Executable.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceJavaScriptCoretestsstressmodulessyntaxerrorwithnamesjs">releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/tests/stress/modules-syntax-error-with-names.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit210SourceJavaScriptCoreAPIJSScriptRefcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/API/JSScriptRef.cpp (188462 => 188463)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/API/JSScriptRef.cpp        2015-08-14 11:33:44 UTC (rev 188462)
+++ releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/API/JSScriptRef.cpp        2015-08-14 11:46:08 UTC (rev 188463)
</span><span class="lines">@@ -70,8 +70,8 @@
</span><span class="cx"> static bool parseScript(VM* vm, const SourceCode& source, ParserError& error)
</span><span class="cx"> {
</span><span class="cx"> return !!JSC::parse<JSC::ProgramNode>(
</span><del>- vm, source, Identifier(), JSParserBuiltinMode::NotBuiltin,
- JSParserStrictMode::NotStrict, JSParserCodeType::Program,
</del><ins>+ vm, source, Identifier(), JSParserBuiltinMode::NotBuiltin,
+ JSParserStrictMode::NotStrict, SourceParseMode::ProgramMode,
</ins><span class="cx"> error);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/ChangeLog (188462 => 188463)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/ChangeLog        2015-08-14 11:33:44 UTC (rev 188462)
+++ releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/ChangeLog        2015-08-14 11:46:08 UTC (rev 188463)
</span><span class="lines">@@ -1,3 +1,103 @@
</span><ins>+2015-08-13 Yusuke Suzuki <utatane.tea@gmail.com>
+
+ Unify JSParserCodeType, FunctionParseMode and ModuleParseMode into SourceParseMode
+ https://bugs.webkit.org/show_bug.cgi?id=147353
+
+ Reviewed by Saam Barati.
+
+ This is the follow-up patch after r188355.
+ It includes the following changes.
+
+ - Unify JSParserCodeType, FunctionParseMode and ModuleParseMode into SourceParseMode
+ - Make SourceParseMode to C++ strongly-typed enum.
+ - Fix the comments.
+ - Rename ModuleSpecifier to ModuleName.
+ - Add the type name `ImportEntry` before the C++11 uniform initialization.
+ - Fix the thrown message for duplicate 'default' names.
+ - Assert the all statements in the top-level source elements are the module declarations under the module analyzer phase.
+
+ * API/JSScriptRef.cpp:
+ (parseScript):
+ * builtins/BuiltinExecutables.cpp:
+ (JSC::BuiltinExecutables::createExecutableInternal):
+ * bytecode/UnlinkedFunctionExecutable.cpp:
+ (JSC::generateFunctionCodeBlock):
+ * bytecode/UnlinkedFunctionExecutable.h:
+ * bytecompiler/BytecodeGenerator.h:
+ (JSC::BytecodeGenerator::makeFunction):
+ * parser/ASTBuilder.h:
+ (JSC::ASTBuilder::createFunctionMetadata):
+ (JSC::ASTBuilder::createModuleName):
+ (JSC::ASTBuilder::createImportDeclaration):
+ (JSC::ASTBuilder::createExportAllDeclaration):
+ (JSC::ASTBuilder::createExportNamedDeclaration):
+ (JSC::ASTBuilder::createModuleSpecifier): Deleted.
+ * parser/ModuleAnalyzer.cpp:
+ (JSC::ModuleAnalyzer::analyze):
+ * parser/NodeConstructors.h:
+ (JSC::ModuleNameNode::ModuleNameNode):
+ (JSC::ImportDeclarationNode::ImportDeclarationNode):
+ (JSC::ExportAllDeclarationNode::ExportAllDeclarationNode):
+ (JSC::ExportNamedDeclarationNode::ExportNamedDeclarationNode):
+ (JSC::ModuleSpecifierNode::ModuleSpecifierNode): Deleted.
+ * parser/Nodes.cpp:
+ (JSC::FunctionMetadataNode::FunctionMetadataNode):
+ * parser/Nodes.h:
+ (JSC::StatementNode::isModuleDeclarationNode):
+ (JSC::ModuleDeclarationNode::isModuleDeclarationNode):
+ (JSC::ImportDeclarationNode::moduleName):
+ (JSC::ExportAllDeclarationNode::moduleName):
+ (JSC::ExportNamedDeclarationNode::moduleName):
+ (JSC::ImportDeclarationNode::moduleSpecifier): Deleted.
+ (JSC::ExportAllDeclarationNode::moduleSpecifier): Deleted.
+ (JSC::ExportNamedDeclarationNode::moduleSpecifier): Deleted.
+ * parser/NodesAnalyzeModule.cpp:
+ (JSC::SourceElements::analyzeModule):
+ (JSC::ImportDeclarationNode::analyzeModule):
+ (JSC::ExportAllDeclarationNode::analyzeModule):
+ (JSC::ExportNamedDeclarationNode::analyzeModule):
+ * parser/Parser.cpp:
+ (JSC::Parser<LexerType>::Parser):
+ (JSC::Parser<LexerType>::parseInner):
+ (JSC::Parser<LexerType>::parseModuleSourceElements):
+ (JSC::Parser<LexerType>::parseFunctionBody):
+ (JSC::stringForFunctionMode):
+ (JSC::Parser<LexerType>::parseFunctionParameters):
+ (JSC::Parser<LexerType>::parseFunctionInfo):
+ (JSC::Parser<LexerType>::parseFunctionDeclaration):
+ (JSC::Parser<LexerType>::parseClass):
+ (JSC::Parser<LexerType>::parseModuleName):
+ (JSC::Parser<LexerType>::parseImportDeclaration):
+ (JSC::Parser<LexerType>::parseExportDeclaration):
+ (JSC::Parser<LexerType>::parsePropertyMethod):
+ (JSC::Parser<LexerType>::parseGetterSetter):
+ (JSC::Parser<LexerType>::parsePrimaryExpression):
+ (JSC::Parser<LexerType>::parseArrowFunctionExpression):
+ (JSC::Parser<LexerType>::parseModuleSpecifier): Deleted.
+ * parser/Parser.h:
+ (JSC::Parser<LexerType>::parse):
+ (JSC::parse):
+ * parser/ParserModes.h:
+ (JSC::isFunctionParseMode):
+ (JSC::isModuleParseMode):
+ (JSC::isProgramParseMode):
+ * parser/SyntaxChecker.h:
+ (JSC::SyntaxChecker::createFunctionMetadata):
+ (JSC::SyntaxChecker::createModuleName):
+ (JSC::SyntaxChecker::createImportDeclaration):
+ (JSC::SyntaxChecker::createExportAllDeclaration):
+ (JSC::SyntaxChecker::createExportNamedDeclaration):
+ (JSC::SyntaxChecker::createModuleSpecifier): Deleted.
+ * runtime/CodeCache.cpp:
+ (JSC::CodeCache::getGlobalCodeBlock):
+ (JSC::CodeCache::getFunctionExecutableFromGlobalCode):
+ * runtime/Completion.cpp:
+ (JSC::checkSyntax):
+ (JSC::checkModuleSyntax):
+ * runtime/Executable.cpp:
+ (JSC::ProgramExecutable::checkSyntax):
+ * tests/stress/modules-syntax-error-with-names.js:
+
</ins><span class="cx"> 2015-08-13 Geoffrey Garen <ggaren@apple.com>
</span><span class="cx">
</span><span class="cx"> Periodic code deletion should delete RegExp code
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceJavaScriptCorebuiltinsBuiltinExecutablescpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp (188462 => 188463)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp        2015-08-14 11:33:44 UTC (rev 188462)
+++ releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp        2015-08-14 11:46:08 UTC (rev 188463)
</span><span class="lines">@@ -69,9 +69,9 @@
</span><span class="cx"> UnlinkedFunctionKind kind = isParsingDefaultConstructor ? UnlinkedNormalFunction : UnlinkedBuiltinFunction;
</span><span class="cx"> RefPtr<SourceProvider> sourceOverride = isParsingDefaultConstructor ? source.provider() : nullptr;
</span><span class="cx"> std::unique_ptr<ProgramNode> program = parse<ProgramNode>(
</span><del>- &m_vm, source, Identifier(), builtinMode,
- JSParserStrictMode::NotStrict, JSParserCodeType::Program, error,
- &positionBeforeLastNewline, FunctionParseMode::NotAFunctionMode, constructorKind);
</del><ins>+ &m_vm, source, Identifier(), builtinMode,
+ JSParserStrictMode::NotStrict, SourceParseMode::ProgramMode, error,
+ &positionBeforeLastNewline, constructorKind);
</ins><span class="cx">
</span><span class="cx"> if (!program) {
</span><span class="cx"> dataLog("Fatal error compiling builtin function '", name.string(), "': ", error.message());
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceJavaScriptCorebytecodeUnlinkedFunctionExecutablecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp (188462 => 188463)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp        2015-08-14 11:33:44 UTC (rev 188462)
+++ releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp        2015-08-14 11:46:08 UTC (rev 188463)
</span><span class="lines">@@ -54,9 +54,9 @@
</span><span class="cx"> {
</span><span class="cx"> JSParserBuiltinMode builtinMode = executable->isBuiltinFunction() ? JSParserBuiltinMode::Builtin : JSParserBuiltinMode::NotBuiltin;
</span><span class="cx"> JSParserStrictMode strictMode = executable->isInStrictContext() ? JSParserStrictMode::Strict : JSParserStrictMode::NotStrict;
</span><ins>+ ASSERT(isFunctionParseMode(executable->parseMode()));
</ins><span class="cx"> std::unique_ptr<FunctionNode> function = parse<FunctionNode>(
</span><del>- &vm, source, executable->name(), builtinMode, strictMode,
- JSParserCodeType::Function, error, nullptr, executable->parseMode());
</del><ins>+ &vm, source, executable->name(), builtinMode, strictMode, executable->parseMode(), error, nullptr);
</ins><span class="cx">
</span><span class="cx"> if (!function) {
</span><span class="cx"> ASSERT(error.isValid());
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceJavaScriptCorebytecodeUnlinkedFunctionExecutableh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h (188462 => 188463)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h        2015-08-14 11:33:44 UTC (rev 188462)
+++ releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h        2015-08-14 11:46:08 UTC (rev 188463)
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx"> const Identifier& inferredName() const { return m_inferredName; }
</span><span class="cx"> JSString* nameValue() const { return m_nameValue.get(); }
</span><span class="cx"> unsigned parameterCount() const { return m_parameterCount; };
</span><del>- FunctionParseMode parseMode() const { return m_parseMode; };
</del><ins>+ SourceParseMode parseMode() const { return m_parseMode; };
</ins><span class="cx"> bool isInStrictContext() const { return m_isInStrictContext; }
</span><span class="cx"> FunctionMode functionMode() const { return static_cast<FunctionMode>(m_functionMode); }
</span><span class="cx"> ConstructorKind constructorKind() const { return static_cast<ConstructorKind>(m_constructorKind); }
</span><span class="lines">@@ -146,7 +146,7 @@
</span><span class="cx"> unsigned m_typeProfilingStartOffset;
</span><span class="cx"> unsigned m_typeProfilingEndOffset;
</span><span class="cx"> unsigned m_parameterCount;
</span><del>- FunctionParseMode m_parseMode;
</del><ins>+ SourceParseMode m_parseMode;
</ins><span class="cx">
</span><span class="cx"> CodeFeatures m_features;
</span><span class="cx">
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceJavaScriptCorebytecompilerBytecodeGeneratorh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h (188462 => 188463)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2015-08-14 11:33:44 UTC (rev 188462)
+++ releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2015-08-14 11:46:08 UTC (rev 188463)
</span><span class="lines">@@ -717,9 +717,9 @@
</span><span class="cx"> VariableEnvironment variablesUnderTDZ;
</span><span class="cx"> getVariablesUnderTDZ(variablesUnderTDZ);
</span><span class="cx">
</span><del>- FunctionParseMode parseMode = metadata->parseMode();
</del><ins>+ SourceParseMode parseMode = metadata->parseMode();
</ins><span class="cx"> ConstructAbility constructAbility = ConstructAbility::CanConstruct;
</span><del>- if (parseMode == GetterMode || parseMode == SetterMode || parseMode == ArrowFunctionMode || (parseMode == MethodMode && metadata->constructorKind() == ConstructorKind::None))
</del><ins>+ if (parseMode == SourceParseMode::GetterMode || parseMode == SourceParseMode::SetterMode || parseMode == SourceParseMode::ArrowFunctionMode || (parseMode == SourceParseMode::MethodMode && metadata->constructorKind() == ConstructorKind::None))
</ins><span class="cx"> constructAbility = ConstructAbility::CannotConstruct;
</span><span class="cx">
</span><span class="cx"> return UnlinkedFunctionExecutable::create(m_vm, m_scopeNode->source(), metadata, isBuiltinFunction() ? UnlinkedBuiltinFunction : UnlinkedNormalFunction, constructAbility, variablesUnderTDZ);
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceJavaScriptCoreparserASTBuilderh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/ASTBuilder.h (188462 => 188463)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/ASTBuilder.h        2015-08-14 11:33:44 UTC (rev 188462)
+++ releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/ASTBuilder.h        2015-08-14 11:46:08 UTC (rev 188463)
</span><span class="lines">@@ -112,7 +112,7 @@
</span><span class="cx"> #if ENABLE(ES6_CLASS_SYNTAX)
</span><span class="cx"> typedef ClassExprNode* ClassExpression;
</span><span class="cx"> #endif
</span><del>- typedef ModuleSpecifierNode* ModuleSpecifier;
</del><ins>+ typedef ModuleNameNode* ModuleName;
</ins><span class="cx"> typedef ImportSpecifierNode* ImportSpecifier;
</span><span class="cx"> typedef ImportSpecifierListNode* ImportSpecifierList;
</span><span class="cx"> typedef ExportSpecifierNode* ExportSpecifier;
</span><span class="lines">@@ -361,7 +361,7 @@
</span><span class="cx"> const JSTokenLocation& startLocation, const JSTokenLocation& endLocation,
</span><span class="cx"> unsigned startColumn, unsigned endColumn, int functionKeywordStart,
</span><span class="cx"> int functionNameStart, int parametersStart, bool inStrictContext,
</span><del>- ConstructorKind constructorKind, unsigned parameterCount, FunctionParseMode mode)
</del><ins>+ ConstructorKind constructorKind, unsigned parameterCount, SourceParseMode mode)
</ins><span class="cx"> {
</span><span class="cx"> return new (m_parserArena) FunctionMetadataNode(
</span><span class="cx"> m_parserArena, startLocation, endLocation, startColumn, endColumn,
</span><span class="lines">@@ -619,9 +619,9 @@
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- ModuleSpecifierNode* createModuleSpecifier(const JSTokenLocation& location, const Identifier& moduleName)
</del><ins>+ ModuleNameNode* createModuleName(const JSTokenLocation& location, const Identifier& moduleName)
</ins><span class="cx"> {
</span><del>- return new (m_parserArena) ModuleSpecifierNode(location, moduleName);
</del><ins>+ return new (m_parserArena) ModuleNameNode(location, moduleName);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> ImportSpecifierNode* createImportSpecifier(const JSTokenLocation& location, const Identifier& importedName, const Identifier& localName)
</span><span class="lines">@@ -639,14 +639,14 @@
</span><span class="cx"> specifierList->append(specifier);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- StatementNode* createImportDeclaration(const JSTokenLocation& location, ImportSpecifierListNode* importSpecifierList, ModuleSpecifierNode* moduleSpecifier)
</del><ins>+ StatementNode* createImportDeclaration(const JSTokenLocation& location, ImportSpecifierListNode* importSpecifierList, ModuleNameNode* moduleName)
</ins><span class="cx"> {
</span><del>- return new (m_parserArena) ImportDeclarationNode(location, importSpecifierList, moduleSpecifier);
</del><ins>+ return new (m_parserArena) ImportDeclarationNode(location, importSpecifierList, moduleName);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- StatementNode* createExportAllDeclaration(const JSTokenLocation& location, ModuleSpecifierNode* moduleSpecifier)
</del><ins>+ StatementNode* createExportAllDeclaration(const JSTokenLocation& location, ModuleNameNode* moduleName)
</ins><span class="cx"> {
</span><del>- return new (m_parserArena) ExportAllDeclarationNode(location, moduleSpecifier);
</del><ins>+ return new (m_parserArena) ExportAllDeclarationNode(location, moduleName);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> StatementNode* createExportDefaultDeclaration(const JSTokenLocation& location, StatementNode* declaration, const Identifier& localName)
</span><span class="lines">@@ -659,9 +659,9 @@
</span><span class="cx"> return new (m_parserArena) ExportLocalDeclarationNode(location, declaration);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- StatementNode* createExportNamedDeclaration(const JSTokenLocation& location, ExportSpecifierListNode* exportSpecifierList, ModuleSpecifierNode* moduleSpecifier)
</del><ins>+ StatementNode* createExportNamedDeclaration(const JSTokenLocation& location, ExportSpecifierListNode* exportSpecifierList, ModuleNameNode* moduleName)
</ins><span class="cx"> {
</span><del>- return new (m_parserArena) ExportNamedDeclarationNode(location, exportSpecifierList, moduleSpecifier);
</del><ins>+ return new (m_parserArena) ExportNamedDeclarationNode(location, exportSpecifierList, moduleName);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> ExportSpecifierNode* createExportSpecifier(const JSTokenLocation& location, const Identifier& localName, const Identifier& exportedName)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceJavaScriptCoreparserModuleAnalyzercpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/ModuleAnalyzer.cpp (188462 => 188463)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/ModuleAnalyzer.cpp        2015-08-14 11:33:44 UTC (rev 188462)
+++ releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/ModuleAnalyzer.cpp        2015-08-14 11:46:08 UTC (rev 188463)
</span><span class="lines">@@ -100,10 +100,10 @@
</span><span class="cx"> Ref<ModuleRecord> ModuleAnalyzer::analyze(ModuleProgramNode& moduleProgramNode)
</span><span class="cx"> {
</span><span class="cx"> // Traverse the module AST and collect
</span><del>- // 1. Import entries
- // 2. Export entries that have FromClause (e.g. export { a } from "mod")
- // 3. Export entries that have star (e.g. export * from "mod")
- // 4. Aliased export names (e.g. export { a as b })
</del><ins>+ // * Import entries
+ // * Export entries that have FromClause (e.g. export { a } from "mod")
+ // * Export entries that have star (e.g. export * from "mod")
+ // * Aliased export names (e.g. export { a as b })
</ins><span class="cx"> moduleProgramNode.analyzeModule(*this);
</span><span class="cx">
</span><span class="cx"> // Based on the collected information, categorize export entries into 3 types.
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceJavaScriptCoreparserNodeConstructorsh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/NodeConstructors.h (188462 => 188463)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/NodeConstructors.h        2015-08-14 11:33:44 UTC (rev 188462)
+++ releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/NodeConstructors.h        2015-08-14 11:46:08 UTC (rev 188463)
</span><span class="lines">@@ -738,7 +738,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>- inline ModuleSpecifierNode::ModuleSpecifierNode(const JSTokenLocation& location, const Identifier& moduleName)
</del><ins>+ inline ModuleNameNode::ModuleNameNode(const JSTokenLocation& location, const Identifier& moduleName)
</ins><span class="cx"> : Node(location)
</span><span class="cx"> , m_moduleName(moduleName)
</span><span class="cx"> {
</span><span class="lines">@@ -751,16 +751,16 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>- inline ImportDeclarationNode::ImportDeclarationNode(const JSTokenLocation& location, ImportSpecifierListNode* importSpecifierList, ModuleSpecifierNode* moduleSpecifier)
</del><ins>+ inline ImportDeclarationNode::ImportDeclarationNode(const JSTokenLocation& location, ImportSpecifierListNode* importSpecifierList, ModuleNameNode* moduleName)
</ins><span class="cx"> : ModuleDeclarationNode(location)
</span><span class="cx"> , m_specifierList(importSpecifierList)
</span><del>- , m_moduleSpecifier(moduleSpecifier)
</del><ins>+ , m_moduleName(moduleName)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>- inline ExportAllDeclarationNode::ExportAllDeclarationNode(const JSTokenLocation& location, ModuleSpecifierNode* moduleSpecifier)
</del><ins>+ inline ExportAllDeclarationNode::ExportAllDeclarationNode(const JSTokenLocation& location, ModuleNameNode* moduleName)
</ins><span class="cx"> : ModuleDeclarationNode(location)
</span><del>- , m_moduleSpecifier(moduleSpecifier)
</del><ins>+ , m_moduleName(moduleName)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -777,10 +777,10 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>- inline ExportNamedDeclarationNode::ExportNamedDeclarationNode(const JSTokenLocation& location, ExportSpecifierListNode* exportSpecifierList, ModuleSpecifierNode* moduleSpecifier)
</del><ins>+ inline ExportNamedDeclarationNode::ExportNamedDeclarationNode(const JSTokenLocation& location, ExportSpecifierListNode* exportSpecifierList, ModuleNameNode* moduleName)
</ins><span class="cx"> : ModuleDeclarationNode(location)
</span><span class="cx"> , m_specifierList(exportSpecifierList)
</span><del>- , m_moduleSpecifier(moduleSpecifier)
</del><ins>+ , m_moduleName(moduleName)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceJavaScriptCoreparserNodescpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/Nodes.cpp (188462 => 188463)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/Nodes.cpp        2015-08-14 11:33:44 UTC (rev 188462)
+++ releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/Nodes.cpp        2015-08-14 11:46:08 UTC (rev 188463)
</span><span class="lines">@@ -151,7 +151,7 @@
</span><span class="cx"> ParserArena&, const JSTokenLocation& startLocation,
</span><span class="cx"> const JSTokenLocation& endLocation, unsigned startColumn, unsigned endColumn,
</span><span class="cx"> int functionKeywordStart, int functionNameStart, int parametersStart, bool isInStrictContext,
</span><del>- ConstructorKind constructorKind, unsigned parameterCount, FunctionParseMode mode)
</del><ins>+ ConstructorKind constructorKind, unsigned parameterCount, SourceParseMode mode)
</ins><span class="cx"> : Node(endLocation)
</span><span class="cx"> , m_startColumn(startColumn)
</span><span class="cx"> , m_endColumn(endColumn)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceJavaScriptCoreparserNodesh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/Nodes.h (188462 => 188463)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/Nodes.h        2015-08-14 11:33:44 UTC (rev 188462)
+++ releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/Nodes.h        2015-08-14 11:46:08 UTC (rev 188463)
</span><span class="lines">@@ -203,6 +203,7 @@
</span><span class="cx"> virtual bool isContinue() const { return false; }
</span><span class="cx"> virtual bool isBlock() const { return false; }
</span><span class="cx"> virtual bool isFuncDeclNode() const { return false; }
</span><ins>+ virtual bool isModuleDeclarationNode() const { return false; }
</ins><span class="cx">
</span><span class="cx"> protected:
</span><span class="cx"> StatementNode* m_next;
</span><span class="lines">@@ -1641,9 +1642,9 @@
</span><span class="cx"> unsigned m_endColumn;
</span><span class="cx"> };
</span><span class="cx">
</span><del>- class ModuleSpecifierNode : public Node {
</del><ins>+ class ModuleNameNode : public Node {
</ins><span class="cx"> public:
</span><del>- ModuleSpecifierNode(const JSTokenLocation&, const Identifier& moduleName);
</del><ins>+ ModuleNameNode(const JSTokenLocation&, const Identifier& moduleName);
</ins><span class="cx">
</span><span class="cx"> const Identifier& moduleName() { return m_moduleName; }
</span><span class="cx">
</span><span class="lines">@@ -1680,6 +1681,7 @@
</span><span class="cx"> class ModuleDeclarationNode : public StatementNode {
</span><span class="cx"> public:
</span><span class="cx"> virtual void analyzeModule(ModuleAnalyzer&) = 0;
</span><ins>+ virtual bool isModuleDeclarationNode() const { return true; }
</ins><span class="cx">
</span><span class="cx"> protected:
</span><span class="cx"> ModuleDeclarationNode(const JSTokenLocation&);
</span><span class="lines">@@ -1687,30 +1689,30 @@
</span><span class="cx">
</span><span class="cx"> class ImportDeclarationNode : public ModuleDeclarationNode {
</span><span class="cx"> public:
</span><del>- ImportDeclarationNode(const JSTokenLocation&, ImportSpecifierListNode*, ModuleSpecifierNode*);
</del><ins>+ ImportDeclarationNode(const JSTokenLocation&, ImportSpecifierListNode*, ModuleNameNode*);
</ins><span class="cx">
</span><span class="cx"> ImportSpecifierListNode* specifierList() const { return m_specifierList; }
</span><del>- ModuleSpecifierNode* moduleSpecifier() const { return m_moduleSpecifier; }
</del><ins>+ ModuleNameNode* moduleName() const { return m_moduleName; }
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> virtual void emitBytecode(BytecodeGenerator&, RegisterID* = 0) override;
</span><span class="cx"> virtual void analyzeModule(ModuleAnalyzer&) override;
</span><span class="cx">
</span><span class="cx"> ImportSpecifierListNode* m_specifierList;
</span><del>- ModuleSpecifierNode* m_moduleSpecifier;
</del><ins>+ ModuleNameNode* m_moduleName;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> class ExportAllDeclarationNode : public ModuleDeclarationNode {
</span><span class="cx"> public:
</span><del>- ExportAllDeclarationNode(const JSTokenLocation&, ModuleSpecifierNode*);
</del><ins>+ ExportAllDeclarationNode(const JSTokenLocation&, ModuleNameNode*);
</ins><span class="cx">
</span><del>- ModuleSpecifierNode* moduleSpecifier() const { return m_moduleSpecifier; }
</del><ins>+ ModuleNameNode* moduleName() const { return m_moduleName; }
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> virtual void emitBytecode(BytecodeGenerator&, RegisterID* = 0) override;
</span><span class="cx"> virtual void analyzeModule(ModuleAnalyzer&) override;
</span><span class="cx">
</span><del>- ModuleSpecifierNode* m_moduleSpecifier;
</del><ins>+ ModuleNameNode* m_moduleName;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> class ExportDefaultDeclarationNode : public ModuleDeclarationNode {
</span><span class="lines">@@ -1767,16 +1769,16 @@
</span><span class="cx">
</span><span class="cx"> class ExportNamedDeclarationNode : public ModuleDeclarationNode {
</span><span class="cx"> public:
</span><del>- ExportNamedDeclarationNode(const JSTokenLocation&, ExportSpecifierListNode*, ModuleSpecifierNode*);
</del><ins>+ ExportNamedDeclarationNode(const JSTokenLocation&, ExportSpecifierListNode*, ModuleNameNode*);
</ins><span class="cx">
</span><span class="cx"> ExportSpecifierListNode* specifierList() const { return m_specifierList; }
</span><del>- ModuleSpecifierNode* moduleSpecifier() const { return m_moduleSpecifier; }
</del><ins>+ ModuleNameNode* moduleName() const { return m_moduleName; }
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> virtual void emitBytecode(BytecodeGenerator&, RegisterID* = 0) override;
</span><span class="cx"> virtual void analyzeModule(ModuleAnalyzer&) override;
</span><span class="cx"> ExportSpecifierListNode* m_specifierList;
</span><del>- ModuleSpecifierNode* m_moduleSpecifier { nullptr };
</del><ins>+ ModuleNameNode* m_moduleName { nullptr };
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> class FunctionParameters : public ParserArenaDeletable {
</span><span class="lines">@@ -1807,7 +1809,7 @@
</span><span class="cx"> ParserArena&, const JSTokenLocation& start, const JSTokenLocation& end,
</span><span class="cx"> unsigned startColumn, unsigned endColumn, int functionKeywordStart,
</span><span class="cx"> int functionNameStart, int parametersStart, bool isInStrictContext,
</span><del>- ConstructorKind, unsigned, FunctionParseMode);
</del><ins>+ ConstructorKind, unsigned, SourceParseMode);
</ins><span class="cx">
</span><span class="cx"> void finishParsing(const SourceCode&, const Identifier&, FunctionMode);
</span><span class="cx">
</span><span class="lines">@@ -1824,7 +1826,7 @@
</span><span class="cx"> unsigned startColumn() const { return m_startColumn; }
</span><span class="cx"> unsigned endColumn() const { return m_endColumn; }
</span><span class="cx"> unsigned parameterCount() const { return m_parameterCount; }
</span><del>- FunctionParseMode parseMode() const { return m_parseMode; }
</del><ins>+ SourceParseMode parseMode() const { return m_parseMode; }
</ins><span class="cx">
</span><span class="cx"> void setEndPosition(JSTextPosition);
</span><span class="cx">
</span><span class="lines">@@ -1855,7 +1857,7 @@
</span><span class="cx"> int m_startStartOffset;
</span><span class="cx"> unsigned m_parameterCount;
</span><span class="cx"> int m_lastLine;
</span><del>- FunctionParseMode m_parseMode;
</del><ins>+ SourceParseMode m_parseMode;
</ins><span class="cx"> unsigned m_isInStrictContext : 1;
</span><span class="cx"> unsigned m_constructorKind : 2;
</span><span class="cx"> };
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceJavaScriptCoreparserNodesAnalyzeModulecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/NodesAnalyzeModule.cpp (188462 => 188463)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/NodesAnalyzeModule.cpp        2015-08-14 11:33:44 UTC (rev 188462)
+++ releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/NodesAnalyzeModule.cpp        2015-08-14 11:46:08 UTC (rev 188463)
</span><span class="lines">@@ -40,16 +40,18 @@
</span><span class="cx"> void SourceElements::analyzeModule(ModuleAnalyzer& analyzer)
</span><span class="cx"> {
</span><span class="cx"> // In the module analyzer phase, only module declarations are included in the top-level SourceElements.
</span><del>- for (StatementNode* statement = m_head; statement; statement = statement->next())
</del><ins>+ for (StatementNode* statement = m_head; statement; statement = statement->next()) {
+ ASSERT(statement->isModuleDeclarationNode());
</ins><span class="cx"> static_cast<ModuleDeclarationNode*>(statement)->analyzeModule(analyzer);
</span><ins>+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void ImportDeclarationNode::analyzeModule(ModuleAnalyzer& analyzer)
</span><span class="cx"> {
</span><del>- analyzer.moduleRecord().appendRequestedModule(m_moduleSpecifier->moduleName());
</del><ins>+ analyzer.moduleRecord().appendRequestedModule(m_moduleName->moduleName());
</ins><span class="cx"> for (auto* specifier : m_specifierList->specifiers()) {
</span><del>- analyzer.moduleRecord().addImportEntry({
- m_moduleSpecifier->moduleName(),
</del><ins>+ analyzer.moduleRecord().addImportEntry(ModuleRecord::ImportEntry {
+ m_moduleName->moduleName(),
</ins><span class="cx"> specifier->importedName(),
</span><span class="cx"> specifier->localName()
</span><span class="cx"> });
</span><span class="lines">@@ -58,8 +60,8 @@
</span><span class="cx">
</span><span class="cx"> void ExportAllDeclarationNode::analyzeModule(ModuleAnalyzer& analyzer)
</span><span class="cx"> {
</span><del>- analyzer.moduleRecord().appendRequestedModule(m_moduleSpecifier->moduleName());
- analyzer.moduleRecord().addStarExportEntry(m_moduleSpecifier->moduleName());
</del><ins>+ analyzer.moduleRecord().appendRequestedModule(m_moduleName->moduleName());
+ analyzer.moduleRecord().addStarExportEntry(m_moduleName->moduleName());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void ExportDefaultDeclarationNode::analyzeModule(ModuleAnalyzer& analyzer)
</span><span class="lines">@@ -73,16 +75,16 @@
</span><span class="cx">
</span><span class="cx"> void ExportNamedDeclarationNode::analyzeModule(ModuleAnalyzer& analyzer)
</span><span class="cx"> {
</span><del>- if (m_moduleSpecifier)
- analyzer.moduleRecord().appendRequestedModule(m_moduleSpecifier->moduleName());
</del><ins>+ if (m_moduleName)
+ analyzer.moduleRecord().appendRequestedModule(m_moduleName->moduleName());
</ins><span class="cx">
</span><span class="cx"> for (auto* specifier : m_specifierList->specifiers()) {
</span><del>- if (m_moduleSpecifier) {
</del><ins>+ if (m_moduleName) {
</ins><span class="cx"> // export { v } from "mod"
</span><span class="cx"> //
</span><span class="cx"> // In this case, no local variable names are imported into the current module.
</span><span class="cx"> // "v" indirectly points the binding in "mod".
</span><del>- analyzer.moduleRecord().addExportEntry(ModuleRecord::ExportEntry::createIndirect(specifier->exportedName(), specifier->localName(), m_moduleSpecifier->moduleName()));
</del><ins>+ analyzer.moduleRecord().addExportEntry(ModuleRecord::ExportEntry::createIndirect(specifier->exportedName(), specifier->localName(), m_moduleName->moduleName()));
</ins><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceJavaScriptCoreparserParsercpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/Parser.cpp (188462 => 188463)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/Parser.cpp        2015-08-14 11:33:44 UTC (rev 188462)
+++ releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/Parser.cpp        2015-08-14 11:46:08 UTC (rev 188463)
</span><span class="lines">@@ -192,7 +192,7 @@
</span><span class="cx"> template <typename LexerType>
</span><span class="cx"> Parser<LexerType>::Parser(
</span><span class="cx"> VM* vm, const SourceCode& source, JSParserBuiltinMode builtinMode,
</span><del>- JSParserStrictMode strictMode, JSParserCodeType codeType,
</del><ins>+ JSParserStrictMode strictMode, SourceParseMode parseMode,
</ins><span class="cx"> ConstructorKind defaultConstructorKind, ThisTDZMode thisTDZMode)
</span><span class="cx"> : m_vm(vm)
</span><span class="cx"> , m_source(&source)
</span><span class="lines">@@ -209,7 +209,6 @@
</span><span class="cx"> , m_parsingBuiltin(builtinMode == JSParserBuiltinMode::Builtin)
</span><span class="cx"> , m_defaultConstructorKind(defaultConstructorKind)
</span><span class="cx"> , m_thisTDZMode(thisTDZMode)
</span><del>- , m_codeType(codeType)
</del><span class="cx"> {
</span><span class="cx"> m_lexer = std::make_unique<LexerType>(vm, builtinMode);
</span><span class="cx"> m_lexer->setCode(source, &m_parserArena);
</span><span class="lines">@@ -219,9 +218,9 @@
</span><span class="cx"> m_token.m_location.lineStartOffset = source.startOffset();
</span><span class="cx"> m_functionCache = vm->addSourceProviderCache(source.provider());
</span><span class="cx"> ScopeRef scope = pushScope();
</span><del>- if (codeType == JSParserCodeType::Function)
</del><ins>+ if (isFunctionParseMode(parseMode))
</ins><span class="cx"> scope->setIsFunction();
</span><del>- if (codeType == JSParserCodeType::Module)
</del><ins>+ if (isModuleParseMode(parseMode))
</ins><span class="cx"> scope->setIsModule();
</span><span class="cx"> if (strictMode == JSParserStrictMode::Strict)
</span><span class="cx"> scope->setStrictMode();
</span><span class="lines">@@ -235,12 +234,10 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template <typename LexerType>
</span><del>-String Parser<LexerType>::parseInner(const Identifier& calleeName, FunctionParseMode parseMode, ModuleParseMode moduleParseMode)
</del><ins>+String Parser<LexerType>::parseInner(const Identifier& calleeName, SourceParseMode parseMode)
</ins><span class="cx"> {
</span><del>- UNUSED_PARAM(moduleParseMode);
</del><ins>+ String parseError = String();
</ins><span class="cx">
</span><del>- String parseError = String();
-
</del><span class="cx"> ASTBuilder context(const_cast<VM*>(m_vm), m_parserArena, const_cast<SourceCode*>(m_source));
</span><span class="cx"> ScopeRef scope = currentScope();
</span><span class="cx"> scope->setIsLexicalScope();
</span><span class="lines">@@ -252,7 +249,7 @@
</span><span class="cx"> m_parameters = functionInfo.parameters;
</span><span class="cx">
</span><span class="cx"> #if ENABLE(ES6_ARROWFUNCTION_SYNTAX)
</span><del>- if (parseMode == ArrowFunctionMode && !hasError()) {
</del><ins>+ if (parseMode == SourceParseMode::ArrowFunctionMode && !hasError()) {
</ins><span class="cx"> // The only way we could have an error wile reparsing is if we run out of stack space.
</span><span class="cx"> RELEASE_ASSERT(match(ARROWFUNCTION));
</span><span class="cx"> next();
</span><span class="lines">@@ -273,8 +270,8 @@
</span><span class="cx"> if (isArrowFunctionBodyExpression)
</span><span class="cx"> sourceElements = parseArrowFunctionSingleExpressionBodySourceElements(context);
</span><span class="cx"> #if ENABLE(ES6_MODULES)
</span><del>- else if (m_codeType == JSParserCodeType::Module)
- sourceElements = parseModuleSourceElements(context, moduleParseMode);
</del><ins>+ else if (isModuleParseMode(parseMode))
+ sourceElements = parseModuleSourceElements(context, parseMode);
</ins><span class="cx"> #endif
</span><span class="cx"> else
</span><span class="cx"> sourceElements = parseSourceElements(context, CheckForStrictMode);
</span><span class="lines">@@ -414,7 +411,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template <typename LexerType>
</span><del>-template <class TreeBuilder> TreeSourceElements Parser<LexerType>::parseModuleSourceElements(TreeBuilder& context, ModuleParseMode moduleParseMode)
</del><ins>+template <class TreeBuilder> TreeSourceElements Parser<LexerType>::parseModuleSourceElements(TreeBuilder& context, SourceParseMode parseMode)
</ins><span class="cx"> {
</span><span class="cx"> TreeSourceElements sourceElements = context.createSourceElements();
</span><span class="cx"> SyntaxChecker syntaxChecker(const_cast<VM*>(m_vm), m_lexer.get());
</span><span class="lines">@@ -428,7 +425,7 @@
</span><span class="cx"> else {
</span><span class="cx"> const Identifier* directive = 0;
</span><span class="cx"> unsigned directiveLiteralLength = 0;
</span><del>- if (moduleParseMode == ModuleParseMode::Analyze) {
</del><ins>+ if (parseMode == SourceParseMode::ModuleAnalyzeMode) {
</ins><span class="cx"> if (!parseStatementListItem(syntaxChecker, directive, &directiveLiteralLength))
</span><span class="cx"> break;
</span><span class="cx"> continue;
</span><span class="lines">@@ -1547,7 +1544,7 @@
</span><span class="cx"> template <typename LexerType>
</span><span class="cx"> template <class TreeBuilder> TreeFunctionBody Parser<LexerType>::parseFunctionBody(
</span><span class="cx"> TreeBuilder& context, const JSTokenLocation& startLocation, int startColumn, int functionKeywordStart, int functionNameStart, int parametersStart,
</span><del>- ConstructorKind constructorKind, FunctionBodyType bodyType, unsigned parameterCount, FunctionParseMode parseMode)
</del><ins>+ ConstructorKind constructorKind, FunctionBodyType bodyType, unsigned parameterCount, SourceParseMode parseMode)
</ins><span class="cx"> {
</span><span class="cx"> if (bodyType == StandardFunctionBodyBlock || bodyType == ArrowFunctionBodyBlock) {
</span><span class="cx"> next();
</span><span class="lines">@@ -1568,20 +1565,22 @@
</span><span class="cx"> return context.createFunctionMetadata(startLocation, tokenLocation(), startColumn, endColumn, functionKeywordStart, functionNameStart, parametersStart, strictMode(), constructorKind, parameterCount, parseMode);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static const char* stringForFunctionMode(FunctionParseMode mode)
</del><ins>+static const char* stringForFunctionMode(SourceParseMode mode)
</ins><span class="cx"> {
</span><span class="cx"> switch (mode) {
</span><del>- case GetterMode:
</del><ins>+ case SourceParseMode::GetterMode:
</ins><span class="cx"> return "getter";
</span><del>- case SetterMode:
</del><ins>+ case SourceParseMode::SetterMode:
</ins><span class="cx"> return "setter";
</span><del>- case NormalFunctionMode:
</del><ins>+ case SourceParseMode::NormalFunctionMode:
</ins><span class="cx"> return "function";
</span><del>- case MethodMode:
</del><ins>+ case SourceParseMode::MethodMode:
</ins><span class="cx"> return "method";
</span><del>- case ArrowFunctionMode:
</del><ins>+ case SourceParseMode::ArrowFunctionMode:
</ins><span class="cx"> return "arrow function";
</span><del>- case NotAFunctionMode:
</del><ins>+ case SourceParseMode::ProgramMode:
+ case SourceParseMode::ModuleAnalyzeMode:
+ case SourceParseMode::ModuleEvaluateMode:
</ins><span class="cx"> RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> return "";
</span><span class="cx"> }
</span><span class="lines">@@ -1589,15 +1588,15 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-template <typename LexerType> template <class TreeBuilder> int Parser<LexerType>::parseFunctionParameters(TreeBuilder& context, FunctionParseMode mode, ParserFunctionInfo<TreeBuilder>& functionInfo)
</del><ins>+template <typename LexerType> template <class TreeBuilder> int Parser<LexerType>::parseFunctionParameters(TreeBuilder& context, SourceParseMode mode, ParserFunctionInfo<TreeBuilder>& functionInfo)
</ins><span class="cx"> {
</span><del>- RELEASE_ASSERT(mode != NotAFunctionMode);
</del><ins>+ RELEASE_ASSERT(mode != SourceParseMode::ProgramMode && mode != SourceParseMode::ModuleAnalyzeMode && mode != SourceParseMode::ModuleEvaluateMode);
</ins><span class="cx"> int parametersStart = m_token.m_location.startOffset;
</span><span class="cx"> TreeFormalParameterList parameterList = context.createFormalParameterList();
</span><span class="cx"> functionInfo.parameters = parameterList;
</span><span class="cx"> functionInfo.startOffset = parametersStart;
</span><span class="cx">
</span><del>- if (mode == ArrowFunctionMode) {
</del><ins>+ if (mode == SourceParseMode::ArrowFunctionMode) {
</ins><span class="cx"> if (!match(IDENT) && !match(OPENPAREN)) {
</span><span class="cx"> semanticFailureDueToKeyword(stringForFunctionMode(mode), " name");
</span><span class="cx"> failWithMessage("Expected an arrow function input parameter");
</span><span class="lines">@@ -1627,10 +1626,10 @@
</span><span class="cx"> failWithMessage("Expected an opening '(' before a ", stringForFunctionMode(mode), "'s parameter list");
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (mode == GetterMode) {
</del><ins>+ if (mode == SourceParseMode::GetterMode) {
</ins><span class="cx"> consumeOrFail(CLOSEPAREN, "getter functions must have no parameters");
</span><span class="cx"> functionInfo.parameterCount = 0;
</span><del>- } else if (mode == SetterMode) {
</del><ins>+ } else if (mode == SourceParseMode::SetterMode) {
</ins><span class="cx"> failIfTrue(match(CLOSEPAREN), "setter functions must have one parameter");
</span><span class="cx"> const Identifier* duplicateParameter = nullptr;
</span><span class="cx"> auto parameter = parseDestructuringPattern(context, DestructureToParameters, ExportType::NotExported, &duplicateParameter);
</span><span class="lines">@@ -1654,9 +1653,9 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template <typename LexerType>
</span><del>-template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuilder& context, FunctionRequirements requirements, FunctionParseMode mode, bool nameIsInContainingScope, ConstructorKind constructorKind, SuperBinding expectedSuperBinding, int functionKeywordStart, ParserFunctionInfo<TreeBuilder>& functionInfo, FunctionParseType parseType)
</del><ins>+template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuilder& context, FunctionRequirements requirements, SourceParseMode mode, bool nameIsInContainingScope, ConstructorKind constructorKind, SuperBinding expectedSuperBinding, int functionKeywordStart, ParserFunctionInfo<TreeBuilder>& functionInfo, FunctionParseType parseType)
</ins><span class="cx"> {
</span><del>- RELEASE_ASSERT(mode != NotAFunctionMode);
</del><ins>+ RELEASE_ASSERT(isFunctionParseMode(mode));
</ins><span class="cx">
</span><span class="cx"> AutoPopScopeRef functionScope(this, pushScope());
</span><span class="cx"> functionScope->setIsFunction();
</span><span class="lines">@@ -1670,7 +1669,7 @@
</span><span class="cx">
</span><span class="cx"> switch (parseType) {
</span><span class="cx"> case StandardFunctionParseType: {
</span><del>- RELEASE_ASSERT(mode != ArrowFunctionMode);
</del><ins>+ RELEASE_ASSERT(mode != SourceParseMode::ArrowFunctionMode);
</ins><span class="cx"> if (match(IDENT) || isLETMaskedAsIDENT()) {
</span><span class="cx"> functionInfo.name = m_token.m_data.ident;
</span><span class="cx"> m_lastFunctionName = functionInfo.name;
</span><span class="lines">@@ -1678,7 +1677,7 @@
</span><span class="cx"> if (!nameIsInContainingScope)
</span><span class="cx"> failIfTrueIfStrict(functionScope->declareVariable(functionInfo.name) & DeclarationResult::InvalidStrictMode, "'", functionInfo.name->impl(), "' is not a valid ", stringForFunctionMode(mode), " name in strict mode");
</span><span class="cx"> } else if (requirements == FunctionNeedsName) {
</span><del>- if (match(OPENPAREN) && mode == NormalFunctionMode)
</del><ins>+ if (match(OPENPAREN) && mode == SourceParseMode::NormalFunctionMode)
</ins><span class="cx"> semanticFail("Function statements must have a name");
</span><span class="cx"> semanticFailureDueToKeyword(stringForFunctionMode(mode), " name");
</span><span class="cx"> failDueToUnexpectedToken();
</span><span class="lines">@@ -1708,7 +1707,7 @@
</span><span class="cx"> }
</span><span class="cx"> #if ENABLE(ES6_ARROWFUNCTION_SYNTAX)
</span><span class="cx"> case ArrowFunctionParseType: {
</span><del>- RELEASE_ASSERT(mode == ArrowFunctionMode);
</del><ins>+ RELEASE_ASSERT(mode == SourceParseMode::ArrowFunctionMode);
</ins><span class="cx">
</span><span class="cx"> startLocation = tokenLocation();
</span><span class="cx"> functionInfo.startLine = tokenLine();
</span><span class="lines">@@ -1804,7 +1803,7 @@
</span><span class="cx"> failIfFalse(functionInfo.body, "Cannot parse the body of this ", stringForFunctionMode(mode));
</span><span class="cx"> context.setEndOffset(functionInfo.body, m_lexer->currentOffset());
</span><span class="cx"> if (functionScope->strictMode() && functionInfo.name) {
</span><del>- RELEASE_ASSERT(mode == NormalFunctionMode || mode == MethodMode || mode == ArrowFunctionMode);
</del><ins>+ RELEASE_ASSERT(mode == SourceParseMode::NormalFunctionMode || mode == SourceParseMode::MethodMode || mode == SourceParseMode::ArrowFunctionMode);
</ins><span class="cx"> semanticFailIfTrue(m_vm->propertyNames->arguments == *functionInfo.name, "'", functionInfo.name->impl(), "' is not a valid function name in strict mode");
</span><span class="cx"> semanticFailIfTrue(m_vm->propertyNames->eval == *functionInfo.name, "'", functionInfo.name->impl(), "' is not a valid function name in strict mode");
</span><span class="cx"> }
</span><span class="lines">@@ -1869,7 +1868,7 @@
</span><span class="cx"> unsigned functionKeywordStart = tokenStart();
</span><span class="cx"> next();
</span><span class="cx"> ParserFunctionInfo<TreeBuilder> functionInfo;
</span><del>- failIfFalse((parseFunctionInfo(context, FunctionNeedsName, NormalFunctionMode, true, ConstructorKind::None, SuperBinding::NotNeeded,
</del><ins>+ failIfFalse((parseFunctionInfo(context, FunctionNeedsName, SourceParseMode::NormalFunctionMode, true, ConstructorKind::None, SuperBinding::NotNeeded,
</ins><span class="cx"> functionKeywordStart, functionInfo, StandardFunctionParseType)), "Cannot parse this function");
</span><span class="cx"> failIfFalse(functionInfo.name, "Function statements must have a name");
</span><span class="cx"> failIfTrueIfStrict(declareVariable(functionInfo.name) & DeclarationResult::InvalidStrictMode, "Cannot declare a function named '", functionInfo.name->impl(), "' in strict mode");
</span><span class="lines">@@ -1999,7 +1998,7 @@
</span><span class="cx"> } else {
</span><span class="cx"> ParserFunctionInfo<TreeBuilder> methodInfo;
</span><span class="cx"> bool isConstructor = !isStaticMethod && *ident == propertyNames.constructor;
</span><del>- failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, MethodMode, false, isConstructor ? constructorKind : ConstructorKind::None, SuperBinding::Needed, methodStart, methodInfo, StandardFunctionParseType)), "Cannot parse this method");
</del><ins>+ failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, SourceParseMode::MethodMode, false, isConstructor ? constructorKind : ConstructorKind::None, SuperBinding::Needed, methodStart, methodInfo, StandardFunctionParseType)), "Cannot parse this method");
</ins><span class="cx"> failIfTrue(!ident || (declareVariable(ident) & DeclarationResult::InvalidStrictMode), "Cannot declare a method named '", methodInfo.name->impl(), "'");
</span><span class="cx"> methodInfo.name = isConstructor ? className : ident;
</span><span class="cx">
</span><span class="lines">@@ -2226,16 +2225,16 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template <typename LexerType>
</span><del>-template <class TreeBuilder> typename TreeBuilder::ModuleSpecifier Parser<LexerType>::parseModuleSpecifier(TreeBuilder& context)
</del><ins>+template <class TreeBuilder> typename TreeBuilder::ModuleName Parser<LexerType>::parseModuleName(TreeBuilder& context)
</ins><span class="cx"> {
</span><del>- // ModuleSpecifier represents the module name imported by the script.
</del><ins>+ // ModuleName (ModuleSpecifier in the spec) represents the module name imported by the script.
</ins><span class="cx"> // http://www.ecma-international.org/ecma-262/6.0/#sec-imports
</span><span class="cx"> // http://www.ecma-international.org/ecma-262/6.0/#sec-exports
</span><span class="cx"> JSTokenLocation specifierLocation(tokenLocation());
</span><span class="cx"> failIfFalse(match(STRING), "Imported modules names must be string literals");
</span><span class="cx"> const Identifier* moduleName = m_token.m_data.ident;
</span><span class="cx"> next();
</span><del>- return context.createModuleSpecifier(specifierLocation, *moduleName);
</del><ins>+ return context.createModuleName(specifierLocation, *moduleName);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template <typename LexerType>
</span><span class="lines">@@ -2327,10 +2326,10 @@
</span><span class="cx">
</span><span class="cx"> if (match(STRING)) {
</span><span class="cx"> // import ModuleSpecifier ;
</span><del>- auto moduleSpecifier = parseModuleSpecifier(context);
- failIfFalse(moduleSpecifier, "Cannot parse the module name");
</del><ins>+ auto moduleName = parseModuleName(context);
+ failIfFalse(moduleName, "Cannot parse the module name");
</ins><span class="cx"> failIfFalse(autoSemiColon(), "Expected a ';' following a targeted import declaration");
</span><del>- return context.createImportDeclaration(importLocation, specifierList, moduleSpecifier);
</del><ins>+ return context.createImportDeclaration(importLocation, specifierList, moduleName);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool isFinishedParsingImport = false;
</span><span class="lines">@@ -2378,11 +2377,11 @@
</span><span class="cx"> failIfFalse(matchContextualKeyword(m_vm->propertyNames->from), "Expected 'from' before imported module name");
</span><span class="cx"> next();
</span><span class="cx">
</span><del>- auto moduleSpecifier = parseModuleSpecifier(context);
- failIfFalse(moduleSpecifier, "Cannot parse the module name");
</del><ins>+ auto moduleName = parseModuleName(context);
+ failIfFalse(moduleName, "Cannot parse the module name");
</ins><span class="cx"> failIfFalse(autoSemiColon(), "Expected a ';' following a targeted import declaration");
</span><span class="cx">
</span><del>- return context.createImportDeclaration(importLocation, specifierList, moduleSpecifier);
</del><ins>+ return context.createImportDeclaration(importLocation, specifierList, moduleName);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template <typename LexerType>
</span><span class="lines">@@ -2427,11 +2426,11 @@
</span><span class="cx">
</span><span class="cx"> failIfFalse(matchContextualKeyword(m_vm->propertyNames->from), "Expected 'from' before exported module name");
</span><span class="cx"> next();
</span><del>- auto moduleSpecifier = parseModuleSpecifier(context);
- failIfFalse(moduleSpecifier, "Cannot parse the 'from' clause");
</del><ins>+ auto moduleName = parseModuleName(context);
+ failIfFalse(moduleName, "Cannot parse the 'from' clause");
</ins><span class="cx"> failIfFalse(autoSemiColon(), "Expected a ';' following a targeted export declaration");
</span><span class="cx">
</span><del>- return context.createExportAllDeclaration(exportLocation, moduleSpecifier);
</del><ins>+ return context.createExportAllDeclaration(exportLocation, moduleName);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> case DEFAULT: {
</span><span class="lines">@@ -2474,6 +2473,9 @@
</span><span class="cx"> //
</span><span class="cx"> // const *default* = expr;
</span><span class="cx"> // export { *default* as default }
</span><ins>+ //
+ // In the above example, *default* is the invisible variable to the users.
+ // We use the private symbol to represent the name of this variable.
</ins><span class="cx"> JSTokenLocation location(tokenLocation());
</span><span class="cx"> JSTextPosition start = tokenStartPosition();
</span><span class="cx"> TreeExpression expression = parseAssignmentExpression(context);
</span><span class="lines">@@ -2481,7 +2483,7 @@
</span><span class="cx">
</span><span class="cx"> DeclarationResultMask declarationResult = declareVariable(&m_vm->propertyNames->starDefaultPrivateName, DeclarationType::ConstDeclaration);
</span><span class="cx"> if (declarationResult & DeclarationResult::InvalidDuplicateDeclaration)
</span><del>- internalFailWithMessage(false, "Cannot export 'default' name twice: '");
</del><ins>+ internalFailWithMessage(false, "Only one 'default' export is allowed");
</ins><span class="cx">
</span><span class="cx"> TreeExpression assignment = context.createAssignResolve(location, m_vm->propertyNames->starDefaultPrivateName, expression, start, start, tokenEndPosition(), AssignmentContext::ConstDeclarationStatement);
</span><span class="cx"> result = context.createExprStatement(location, assignment, start, tokenEndPosition());
</span><span class="lines">@@ -2491,7 +2493,7 @@
</span><span class="cx"> }
</span><span class="cx"> failIfFalse(result, "Cannot parse the declaration");
</span><span class="cx">
</span><del>- semanticFailIfFalse(exportName(m_vm->propertyNames->defaultKeyword), "Cannot export 'default' name twice.");
</del><ins>+ semanticFailIfFalse(exportName(m_vm->propertyNames->defaultKeyword), "Only one 'default' export is allowed");
</ins><span class="cx"> currentScope()->moduleScopeData().exportBinding(*localName);
</span><span class="cx"> return context.createExportDefaultDeclaration(exportLocation, result, *localName);
</span><span class="cx"> }
</span><span class="lines">@@ -2525,15 +2527,15 @@
</span><span class="cx"> }
</span><span class="cx"> handleProductionOrFail(CLOSEBRACE, "}", "end", "export list");
</span><span class="cx">
</span><del>- typename TreeBuilder::ModuleSpecifier moduleSpecifier = 0;
</del><ins>+ typename TreeBuilder::ModuleName moduleName = 0;
</ins><span class="cx"> if (matchContextualKeyword(m_vm->propertyNames->from)) {
</span><span class="cx"> next();
</span><del>- moduleSpecifier = parseModuleSpecifier(context);
- failIfFalse(moduleSpecifier, "Cannot parse the 'from' clause");
</del><ins>+ moduleName = parseModuleName(context);
+ failIfFalse(moduleName, "Cannot parse the 'from' clause");
</ins><span class="cx"> }
</span><span class="cx"> failIfFalse(autoSemiColon(), "Expected a ';' following a targeted export declaration");
</span><span class="cx">
</span><del>- if (!moduleSpecifier) {
</del><ins>+ if (!moduleName) {
</ins><span class="cx"> semanticFailIfTrue(hasKeywordForLocalBindings, "Cannot use keyword as exported variable name");
</span><span class="cx"> // Since this export declaration does not have module specifier part, it exports the local bindings.
</span><span class="cx"> // While the export declaration with module specifier does not have any effect on the current module's scope,
</span><span class="lines">@@ -2549,7 +2551,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- return context.createExportNamedDeclaration(exportLocation, specifierList, moduleSpecifier);
</del><ins>+ return context.createExportNamedDeclaration(exportLocation, specifierList, moduleName);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> default: {
</span><span class="lines">@@ -2886,7 +2888,7 @@
</span><span class="cx"> JSTokenLocation methodLocation(tokenLocation());
</span><span class="cx"> unsigned methodStart = tokenStart();
</span><span class="cx"> ParserFunctionInfo<TreeBuilder> methodInfo;
</span><del>- failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, MethodMode, false, ConstructorKind::None, SuperBinding::NotNeeded, methodStart, methodInfo, StandardFunctionParseType)), "Cannot parse this method");
</del><ins>+ failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, SourceParseMode::MethodMode, false, ConstructorKind::None, SuperBinding::NotNeeded, methodStart, methodInfo, StandardFunctionParseType)), "Cannot parse this method");
</ins><span class="cx"> methodInfo.name = methodName;
</span><span class="cx"> return context.createFunctionExpr(methodLocation, methodInfo);
</span><span class="cx"> }
</span><span class="lines">@@ -2912,11 +2914,11 @@
</span><span class="cx"> ParserFunctionInfo<TreeBuilder> info;
</span><span class="cx"> if (type & PropertyNode::Getter) {
</span><span class="cx"> failIfFalse(match(OPENPAREN), "Expected a parameter list for getter definition");
</span><del>- failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, GetterMode, false, constructorKind, superBinding,
</del><ins>+ failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, SourceParseMode::GetterMode, false, constructorKind, superBinding,
</ins><span class="cx"> getterOrSetterStartOffset, info, StandardFunctionParseType)), "Cannot parse getter definition");
</span><span class="cx"> } else {
</span><span class="cx"> failIfFalse(match(OPENPAREN), "Expected a parameter list for setter definition");
</span><del>- failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, SetterMode, false, constructorKind, superBinding,
</del><ins>+ failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, SourceParseMode::SetterMode, false, constructorKind, superBinding,
</ins><span class="cx"> getterOrSetterStartOffset, info, StandardFunctionParseType)), "Cannot parse setter definition");
</span><span class="cx"> }
</span><span class="cx"> if (stringPropertyName)
</span><span class="lines">@@ -3184,7 +3186,7 @@
</span><span class="cx"> next();
</span><span class="cx"> ParserFunctionInfo<TreeBuilder> info;
</span><span class="cx"> info.name = &m_vm->propertyNames->nullIdentifier;
</span><del>- failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, NormalFunctionMode, false, ConstructorKind::None, SuperBinding::NotNeeded, functionKeywordStart, info, StandardFunctionParseType)), "Cannot parse function expression");
</del><ins>+ failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, SourceParseMode::NormalFunctionMode, false, ConstructorKind::None, SuperBinding::NotNeeded, functionKeywordStart, info, StandardFunctionParseType)), "Cannot parse function expression");
</ins><span class="cx"> return context.createFunctionExpr(location, info);
</span><span class="cx"> }
</span><span class="cx"> #if ENABLE(ES6_CLASS_SYNTAX)
</span><span class="lines">@@ -3456,7 +3458,7 @@
</span><span class="cx"> location = tokenLocation();
</span><span class="cx"> ParserFunctionInfo<TreeBuilder> info;
</span><span class="cx"> info.name = &m_vm->propertyNames->nullIdentifier;
</span><del>- failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, ArrowFunctionMode, true, ConstructorKind::None, SuperBinding::NotNeeded, functionKeywordStart, info, ArrowFunctionParseType)), "Cannot parse arrow function expression");
</del><ins>+ failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, SourceParseMode::ArrowFunctionMode, true, ConstructorKind::None, SuperBinding::NotNeeded, functionKeywordStart, info, ArrowFunctionParseType)), "Cannot parse arrow function expression");
</ins><span class="cx">
</span><span class="cx"> return context.createArrowFunctionExpr(location, info);
</span><span class="cx"> }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceJavaScriptCoreparserParserh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/Parser.h (188462 => 188463)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/Parser.h        2015-08-14 11:33:44 UTC (rev 188462)
+++ releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/Parser.h        2015-08-14 11:46:08 UTC (rev 188463)
</span><span class="lines">@@ -615,12 +615,12 @@
</span><span class="cx">
</span><span class="cx"> public:
</span><span class="cx"> Parser(
</span><del>- VM*, const SourceCode&, JSParserBuiltinMode, JSParserStrictMode, JSParserCodeType,
</del><ins>+ VM*, const SourceCode&, JSParserBuiltinMode, JSParserStrictMode, SourceParseMode,
</ins><span class="cx"> ConstructorKind defaultConstructorKind = ConstructorKind::None, ThisTDZMode = ThisTDZMode::CheckIfNeeded);
</span><span class="cx"> ~Parser();
</span><span class="cx">
</span><span class="cx"> template <class ParsedNode>
</span><del>- std::unique_ptr<ParsedNode> parse(ParserError&, const Identifier&, FunctionParseMode, ModuleParseMode);
</del><ins>+ std::unique_ptr<ParsedNode> parse(ParserError&, const Identifier&, SourceParseMode);
</ins><span class="cx">
</span><span class="cx"> JSTextPosition positionBeforeLastNewline() const { return m_lexer->positionBeforeLastNewline(); }
</span><span class="cx"> JSTokenLocation locationBeforeLastToken() const { return m_lexer->lastTokenLocation(); }
</span><span class="lines">@@ -848,7 +848,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Parser();
</span><del>- String parseInner(const Identifier&, FunctionParseMode, ModuleParseMode);
</del><ins>+ String parseInner(const Identifier&, SourceParseMode);
</ins><span class="cx">
</span><span class="cx"> void didFinishParsing(SourceElements*, DeclarationStacks::FunctionStack&, VariableEnvironment&, CodeFeatures, int, const Vector<RefPtr<UniquedStringImpl>>&&);
</span><span class="cx">
</span><span class="lines">@@ -1103,7 +1103,7 @@
</span><span class="cx"> template <class TreeBuilder> TreeProperty parseProperty(TreeBuilder&, bool strict);
</span><span class="cx"> template <class TreeBuilder> TreeExpression parsePropertyMethod(TreeBuilder& context, const Identifier* methodName);
</span><span class="cx"> template <class TreeBuilder> TreeProperty parseGetterSetter(TreeBuilder&, bool strict, PropertyNode::Type, unsigned getterOrSetterStartOffset, ConstructorKind = ConstructorKind::None, SuperBinding = SuperBinding::NotNeeded);
</span><del>- template <class TreeBuilder> ALWAYS_INLINE TreeFunctionBody parseFunctionBody(TreeBuilder&, const JSTokenLocation&, int, int functionKeywordStart, int functionNameStart, int parametersStart, ConstructorKind, FunctionBodyType, unsigned, FunctionParseMode);
</del><ins>+ template <class TreeBuilder> ALWAYS_INLINE TreeFunctionBody parseFunctionBody(TreeBuilder&, const JSTokenLocation&, int, int functionKeywordStart, int functionNameStart, int parametersStart, ConstructorKind, FunctionBodyType, unsigned, SourceParseMode);
</ins><span class="cx"> template <class TreeBuilder> ALWAYS_INLINE bool parseFormalParameters(TreeBuilder&, TreeFormalParameterList, unsigned&);
</span><span class="cx"> enum VarDeclarationListContext { ForLoopContext, VarDeclarationContext };
</span><span class="cx"> template <class TreeBuilder> TreeExpression parseVariableDeclarationList(TreeBuilder&, int& declarations, TreeDestructuringPattern& lastPattern, TreeExpression& lastInitializer, JSTextPosition& identStart, JSTextPosition& initStart, JSTextPosition& initEnd, VarDeclarationListContext, DeclarationType, ExportType, bool& forLoopConstDoesNotHaveInitializer);
</span><span class="lines">@@ -1113,17 +1113,17 @@
</span><span class="cx"> template <class TreeBuilder> NEVER_INLINE TreeDestructuringPattern parseDestructuringPattern(TreeBuilder&, DestructuringKind, ExportType, const Identifier** duplicateIdentifier = nullptr, bool* hasDestructuringPattern = nullptr, AssignmentContext = AssignmentContext::DeclarationStatement, int depth = 0);
</span><span class="cx"> template <class TreeBuilder> NEVER_INLINE TreeDestructuringPattern tryParseDestructuringPatternExpression(TreeBuilder&, AssignmentContext);
</span><span class="cx"> template <class TreeBuilder> NEVER_INLINE TreeExpression parseDefaultValueForDestructuringPattern(TreeBuilder&);
</span><del>- template <class TreeBuilder> TreeSourceElements parseModuleSourceElements(TreeBuilder&, ModuleParseMode);
</del><ins>+ template <class TreeBuilder> TreeSourceElements parseModuleSourceElements(TreeBuilder&, SourceParseMode);
</ins><span class="cx"> enum class ImportSpecifierType { NamespaceImport, NamedImport, DefaultImport };
</span><span class="cx"> template <class TreeBuilder> typename TreeBuilder::ImportSpecifier parseImportClauseItem(TreeBuilder&, ImportSpecifierType);
</span><del>- template <class TreeBuilder> typename TreeBuilder::ModuleSpecifier parseModuleSpecifier(TreeBuilder&);
</del><ins>+ template <class TreeBuilder> typename TreeBuilder::ModuleName parseModuleName(TreeBuilder&);
</ins><span class="cx"> template <class TreeBuilder> TreeStatement parseImportDeclaration(TreeBuilder&);
</span><span class="cx"> template <class TreeBuilder> typename TreeBuilder::ExportSpecifier parseExportSpecifier(TreeBuilder& context, Vector<const Identifier*>& maybeLocalNames, bool& hasKeywordForLocalBindings);
</span><span class="cx"> template <class TreeBuilder> TreeStatement parseExportDeclaration(TreeBuilder&);
</span><span class="cx">
</span><del>- template <class TreeBuilder> NEVER_INLINE bool parseFunctionInfo(TreeBuilder&, FunctionRequirements, FunctionParseMode, bool nameIsInContainingScope, ConstructorKind, SuperBinding, int functionKeywordStart, ParserFunctionInfo<TreeBuilder>&, FunctionParseType);
</del><ins>+ template <class TreeBuilder> NEVER_INLINE bool parseFunctionInfo(TreeBuilder&, FunctionRequirements, SourceParseMode, bool nameIsInContainingScope, ConstructorKind, SuperBinding, int functionKeywordStart, ParserFunctionInfo<TreeBuilder>&, FunctionParseType);
</ins><span class="cx">
</span><del>- template <class TreeBuilder> NEVER_INLINE int parseFunctionParameters(TreeBuilder&, FunctionParseMode, ParserFunctionInfo<TreeBuilder>&);
</del><ins>+ template <class TreeBuilder> NEVER_INLINE int parseFunctionParameters(TreeBuilder&, SourceParseMode, ParserFunctionInfo<TreeBuilder>&);
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(ES6_CLASS_SYNTAX)
</span><span class="cx"> template <class TreeBuilder> NEVER_INLINE TreeClassExpression parseClass(TreeBuilder&, FunctionRequirements, ParserClassInfo<TreeBuilder>&);
</span><span class="lines">@@ -1247,7 +1247,6 @@
</span><span class="cx"> Vector<RefPtr<UniquedStringImpl>> m_closedVariables;
</span><span class="cx"> CodeFeatures m_features;
</span><span class="cx"> int m_numConstants;
</span><del>- JSParserCodeType m_codeType;
</del><span class="cx">
</span><span class="cx"> struct DepthManager {
</span><span class="cx"> DepthManager(int* depth)
</span><span class="lines">@@ -1270,7 +1269,7 @@
</span><span class="cx">
</span><span class="cx"> template <typename LexerType>
</span><span class="cx"> template <class ParsedNode>
</span><del>-std::unique_ptr<ParsedNode> Parser<LexerType>::parse(ParserError& error, const Identifier& calleeName, FunctionParseMode parseMode, ModuleParseMode moduleParseMode)
</del><ins>+std::unique_ptr<ParsedNode> Parser<LexerType>::parse(ParserError& error, const Identifier& calleeName, SourceParseMode parseMode)
</ins><span class="cx"> {
</span><span class="cx"> int errLine;
</span><span class="cx"> String errMsg;
</span><span class="lines">@@ -1287,7 +1286,7 @@
</span><span class="cx"> ASSERT(m_source->startColumn() > 0);
</span><span class="cx"> unsigned startColumn = m_source->startColumn() - 1;
</span><span class="cx">
</span><del>- String parseError = parseInner(calleeName, parseMode, moduleParseMode);
</del><ins>+ String parseError = parseInner(calleeName, parseMode);
</ins><span class="cx">
</span><span class="cx"> int lineNumber = m_lexer->lineNumber();
</span><span class="cx"> bool lexError = m_lexer->sawError();
</span><span class="lines">@@ -1353,18 +1352,17 @@
</span><span class="cx"> std::unique_ptr<ParsedNode> parse(
</span><span class="cx"> VM* vm, const SourceCode& source,
</span><span class="cx"> const Identifier& name, JSParserBuiltinMode builtinMode,
</span><del>- JSParserStrictMode strictMode, JSParserCodeType codeType,
</del><ins>+ JSParserStrictMode strictMode, SourceParseMode parseMode,
</ins><span class="cx"> ParserError& error, JSTextPosition* positionBeforeLastNewline = nullptr,
</span><del>- FunctionParseMode parseMode = NotAFunctionMode, ConstructorKind defaultConstructorKind = ConstructorKind::None,
- ThisTDZMode thisTDZMode = ThisTDZMode::CheckIfNeeded,
- ModuleParseMode moduleParseMode = ModuleParseMode::Analyze)
</del><ins>+ ConstructorKind defaultConstructorKind = ConstructorKind::None,
+ ThisTDZMode thisTDZMode = ThisTDZMode::CheckIfNeeded)
</ins><span class="cx"> {
</span><span class="cx"> SamplingRegion samplingRegion("Parsing");
</span><span class="cx">
</span><span class="cx"> ASSERT(!source.provider()->source().isNull());
</span><span class="cx"> if (source.provider()->source().is8Bit()) {
</span><del>- Parser<Lexer<LChar>> parser(vm, source, builtinMode, strictMode, codeType, defaultConstructorKind, thisTDZMode);
- std::unique_ptr<ParsedNode> result = parser.parse<ParsedNode>(error, name, parseMode, moduleParseMode);
</del><ins>+ Parser<Lexer<LChar>> parser(vm, source, builtinMode, strictMode, parseMode, defaultConstructorKind, thisTDZMode);
+ std::unique_ptr<ParsedNode> result = parser.parse<ParsedNode>(error, name, parseMode);
</ins><span class="cx"> if (positionBeforeLastNewline)
</span><span class="cx"> *positionBeforeLastNewline = parser.positionBeforeLastNewline();
</span><span class="cx"> if (builtinMode == JSParserBuiltinMode::Builtin) {
</span><span class="lines">@@ -1376,8 +1374,8 @@
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx"> ASSERT_WITH_MESSAGE(defaultConstructorKind == ConstructorKind::None, "BuiltinExecutables::createDefaultConstructor should always use a 8-bit string");
</span><del>- Parser<Lexer<UChar>> parser(vm, source, builtinMode, strictMode, codeType, defaultConstructorKind, thisTDZMode);
- std::unique_ptr<ParsedNode> result = parser.parse<ParsedNode>(error, name, parseMode, moduleParseMode);
</del><ins>+ Parser<Lexer<UChar>> parser(vm, source, builtinMode, strictMode, parseMode, defaultConstructorKind, thisTDZMode);
+ std::unique_ptr<ParsedNode> result = parser.parse<ParsedNode>(error, name, parseMode);
</ins><span class="cx"> if (positionBeforeLastNewline)
</span><span class="cx"> *positionBeforeLastNewline = parser.positionBeforeLastNewline();
</span><span class="cx"> return result;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceJavaScriptCoreparserParserModesh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/ParserModes.h (188462 => 188463)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/ParserModes.h        2015-08-14 11:33:44 UTC (rev 188462)
+++ releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/ParserModes.h        2015-08-14 11:46:08 UTC (rev 188463)
</span><span class="lines">@@ -38,22 +38,80 @@
</span><span class="cx"> enum class ConstructorKind { None, Base, Derived };
</span><span class="cx"> enum class SuperBinding { Needed, NotNeeded };
</span><span class="cx"> enum class ThisTDZMode { AlwaysCheck, CheckIfNeeded };
</span><del>-enum class ModuleParseMode { Analyze, Evaluate };
</del><span class="cx">
</span><span class="cx"> enum ProfilerMode { ProfilerOff, ProfilerOn };
</span><span class="cx"> enum DebuggerMode { DebuggerOff, DebuggerOn };
</span><span class="cx">
</span><span class="cx"> enum FunctionMode { FunctionExpression, FunctionDeclaration };
</span><span class="cx">
</span><del>-enum FunctionParseMode {
</del><ins>+enum class SourceParseMode {
</ins><span class="cx"> NormalFunctionMode,
</span><span class="cx"> GetterMode,
</span><span class="cx"> SetterMode,
</span><span class="cx"> MethodMode,
</span><del>- NotAFunctionMode,
- ArrowFunctionMode
</del><ins>+ ArrowFunctionMode,
+ ProgramMode,
+ ModuleAnalyzeMode,
+ ModuleEvaluateMode
</ins><span class="cx"> };
</span><span class="cx">
</span><ins>+inline bool isFunctionParseMode(SourceParseMode parseMode)
+{
+ switch (parseMode) {
+ case SourceParseMode::NormalFunctionMode:
+ case SourceParseMode::GetterMode:
+ case SourceParseMode::SetterMode:
+ case SourceParseMode::MethodMode:
+ case SourceParseMode::ArrowFunctionMode:
+ return true;
+
+ case SourceParseMode::ProgramMode:
+ case SourceParseMode::ModuleAnalyzeMode:
+ case SourceParseMode::ModuleEvaluateMode:
+ return false;
+ }
+ RELEASE_ASSERT_NOT_REACHED();
+ return false;
+}
+
+inline bool isModuleParseMode(SourceParseMode parseMode)
+{
+ switch (parseMode) {
+ case SourceParseMode::ModuleAnalyzeMode:
+ case SourceParseMode::ModuleEvaluateMode:
+ return true;
+
+ case SourceParseMode::NormalFunctionMode:
+ case SourceParseMode::GetterMode:
+ case SourceParseMode::SetterMode:
+ case SourceParseMode::MethodMode:
+ case SourceParseMode::ArrowFunctionMode:
+ case SourceParseMode::ProgramMode:
+ return false;
+ }
+ RELEASE_ASSERT_NOT_REACHED();
+ return false;
+}
+
+inline bool isProgramParseMode(SourceParseMode parseMode)
+{
+ switch (parseMode) {
+ case SourceParseMode::ProgramMode:
+ return true;
+
+ case SourceParseMode::NormalFunctionMode:
+ case SourceParseMode::GetterMode:
+ case SourceParseMode::SetterMode:
+ case SourceParseMode::MethodMode:
+ case SourceParseMode::ArrowFunctionMode:
+ case SourceParseMode::ModuleAnalyzeMode:
+ case SourceParseMode::ModuleEvaluateMode:
+ return false;
+ }
+ RELEASE_ASSERT_NOT_REACHED();
+ return false;
+}
+
</ins><span class="cx"> inline bool functionNameIsInScope(const Identifier& name, FunctionMode functionMode)
</span><span class="cx"> {
</span><span class="cx"> if (name.isNull())
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceJavaScriptCoreparserSyntaxCheckerh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/SyntaxChecker.h (188462 => 188463)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/SyntaxChecker.h        2015-08-14 11:33:44 UTC (rev 188462)
+++ releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/parser/SyntaxChecker.h        2015-08-14 11:46:08 UTC (rev 188463)
</span><span class="lines">@@ -84,7 +84,7 @@
</span><span class="cx"> TemplateStringResult, TemplateStringListResult,
</span><span class="cx"> TemplateExpressionListResult, TemplateExpr,
</span><span class="cx"> TaggedTemplateExpr,
</span><del>- ModuleSpecifierResult,
</del><ins>+ ModuleNameResult,
</ins><span class="cx"> ImportSpecifierResult, ImportSpecifierListResult,
</span><span class="cx"> ExportSpecifierResult, ExportSpecifierListResult
</span><span class="cx"> };
</span><span class="lines">@@ -127,7 +127,7 @@
</span><span class="cx"> #if ENABLE(ES6_CLASS_SYNTAX)
</span><span class="cx"> typedef int ClassExpression;
</span><span class="cx"> #endif
</span><del>- typedef int ModuleSpecifier;
</del><ins>+ typedef int ModuleName;
</ins><span class="cx"> typedef int ImportSpecifier;
</span><span class="cx"> typedef int ImportSpecifierList;
</span><span class="cx"> typedef int ExportSpecifier;
</span><span class="lines">@@ -186,7 +186,7 @@
</span><span class="cx"> ClassExpression createClassExpr(const JSTokenLocation&, const Identifier&, ExpressionType, ExpressionType, PropertyList, PropertyList) { return ClassExpr; }
</span><span class="cx"> #endif
</span><span class="cx"> ExpressionType createFunctionExpr(const JSTokenLocation&, const ParserFunctionInfo<SyntaxChecker>&) { return FunctionExpr; }
</span><del>- int createFunctionMetadata(const JSTokenLocation&, const JSTokenLocation&, int, int, bool, int, int, int, ConstructorKind, unsigned, int) { return FunctionBodyResult; }
</del><ins>+ int createFunctionMetadata(const JSTokenLocation&, const JSTokenLocation&, int, int, bool, int, int, int, ConstructorKind, unsigned, SourceParseMode) { return FunctionBodyResult; }
</ins><span class="cx"> ExpressionType createArrowFunctionExpr(const JSTokenLocation&, const ParserFunctionInfo<SyntaxChecker>&) { return FunctionExpr; }
</span><span class="cx"> void setFunctionNameStart(int, int) { }
</span><span class="cx"> int createArguments() { return ArgumentsResult; }
</span><span class="lines">@@ -259,15 +259,15 @@
</span><span class="cx"> int createThrowStatement(const JSTokenLocation&, int, int, int) { return StatementResult; }
</span><span class="cx"> int createDebugger(const JSTokenLocation&, int, int) { return StatementResult; }
</span><span class="cx"> int createConstStatement(const JSTokenLocation&, int, int, int) { return StatementResult; }
</span><del>- int createModuleSpecifier(const JSTokenLocation&, const Identifier&) { return ModuleSpecifierResult; }
</del><ins>+ int createModuleName(const JSTokenLocation&, const Identifier&) { return ModuleNameResult; }
</ins><span class="cx"> ImportSpecifier createImportSpecifier(const JSTokenLocation&, const Identifier&, const Identifier&) { return ImportSpecifierResult; }
</span><span class="cx"> ImportSpecifierList createImportSpecifierList() { return ImportSpecifierListResult; }
</span><span class="cx"> void appendImportSpecifier(ImportSpecifierList, ImportSpecifier) { }
</span><del>- int createImportDeclaration(const JSTokenLocation&, ImportSpecifierList, ModuleSpecifier) { return StatementResult; }
- int createExportAllDeclaration(const JSTokenLocation&, ModuleSpecifier) { return StatementResult; }
</del><ins>+ int createImportDeclaration(const JSTokenLocation&, ImportSpecifierList, ModuleName) { return StatementResult; }
+ int createExportAllDeclaration(const JSTokenLocation&, ModuleName) { return StatementResult; }
</ins><span class="cx"> int createExportDefaultDeclaration(const JSTokenLocation&, int, const Identifier&) { return StatementResult; }
</span><span class="cx"> int createExportLocalDeclaration(const JSTokenLocation&, int) { return StatementResult; }
</span><del>- int createExportNamedDeclaration(const JSTokenLocation&, ExportSpecifierList, ModuleSpecifier) { return StatementResult; }
</del><ins>+ int createExportNamedDeclaration(const JSTokenLocation&, ExportSpecifierList, ModuleName) { return StatementResult; }
</ins><span class="cx"> ExportSpecifier createExportSpecifier(const JSTokenLocation&, const Identifier&, const Identifier&) { return ExportSpecifierResult; }
</span><span class="cx"> ExportSpecifierList createExportSpecifierList() { return ExportSpecifierListResult; }
</span><span class="cx"> void appendExportSpecifier(ExportSpecifierList, ExportSpecifier) { }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceJavaScriptCoreruntimeCodeCachecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/runtime/CodeCache.cpp (188462 => 188463)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/runtime/CodeCache.cpp        2015-08-14 11:33:44 UTC (rev 188462)
+++ releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/runtime/CodeCache.cpp        2015-08-14 11:46:08 UTC (rev 188463)
</span><span class="lines">@@ -94,8 +94,8 @@
</span><span class="cx">
</span><span class="cx"> typedef typename CacheTypes<UnlinkedCodeBlockType>::RootNode RootNode;
</span><span class="cx"> std::unique_ptr<RootNode> rootNode = parse<RootNode>(
</span><del>- &vm, source, Identifier(), builtinMode, strictMode,
- JSParserCodeType::Program, error, nullptr, FunctionParseMode::NotAFunctionMode, ConstructorKind::None, thisTDZMode);
</del><ins>+ &vm, source, Identifier(), builtinMode, strictMode,
+ SourceParseMode::ProgramMode, error, nullptr, ConstructorKind::None, thisTDZMode);
</ins><span class="cx"> if (!rootNode)
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><span class="lines">@@ -145,8 +145,8 @@
</span><span class="cx">
</span><span class="cx"> JSTextPosition positionBeforeLastNewline;
</span><span class="cx"> std::unique_ptr<ProgramNode> program = parse<ProgramNode>(
</span><del>- &vm, source, Identifier(), JSParserBuiltinMode::NotBuiltin,
- JSParserStrictMode::NotStrict, JSParserCodeType::Program,
</del><ins>+ &vm, source, Identifier(), JSParserBuiltinMode::NotBuiltin,
+ JSParserStrictMode::NotStrict, SourceParseMode::ProgramMode,
</ins><span class="cx"> error, &positionBeforeLastNewline);
</span><span class="cx"> if (!program) {
</span><span class="cx"> RELEASE_ASSERT(error.isValid());
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceJavaScriptCoreruntimeCompletioncpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/runtime/Completion.cpp (188462 => 188463)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/runtime/Completion.cpp        2015-08-14 11:33:44 UTC (rev 188462)
+++ releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/runtime/Completion.cpp        2015-08-14 11:46:08 UTC (rev 188463)
</span><span class="lines">@@ -59,8 +59,8 @@
</span><span class="cx"> JSLockHolder lock(vm);
</span><span class="cx"> RELEASE_ASSERT(vm.atomicStringTable() == wtfThreadData().atomicStringTable());
</span><span class="cx"> return !!parse<ProgramNode>(
</span><del>- &vm, source, Identifier(), JSParserBuiltinMode::NotBuiltin,
- JSParserStrictMode::NotStrict, JSParserCodeType::Program, error);
</del><ins>+ &vm, source, Identifier(), JSParserBuiltinMode::NotBuiltin,
+ JSParserStrictMode::NotStrict, SourceParseMode::ProgramMode, error);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool checkModuleSyntax(VM& vm, const SourceCode& source, ParserError& error)
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx"> RELEASE_ASSERT(vm.atomicStringTable() == wtfThreadData().atomicStringTable());
</span><span class="cx"> std::unique_ptr<ModuleProgramNode> moduleProgramNode = parse<ModuleProgramNode>(
</span><span class="cx"> &vm, source, Identifier(), JSParserBuiltinMode::NotBuiltin,
</span><del>- JSParserStrictMode::Strict, JSParserCodeType::Module, error);
</del><ins>+ JSParserStrictMode::Strict, SourceParseMode::ModuleAnalyzeMode, error);
</ins><span class="cx"> if (!moduleProgramNode)
</span><span class="cx"> return false;
</span><span class="cx">
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceJavaScriptCoreruntimeExecutablecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/runtime/Executable.cpp (188462 => 188463)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/runtime/Executable.cpp        2015-08-14 11:33:44 UTC (rev 188462)
+++ releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/runtime/Executable.cpp        2015-08-14 11:46:08 UTC (rev 188463)
</span><span class="lines">@@ -462,7 +462,7 @@
</span><span class="cx"> JSGlobalObject* lexicalGlobalObject = exec->lexicalGlobalObject();
</span><span class="cx"> std::unique_ptr<ProgramNode> programNode = parse<ProgramNode>(
</span><span class="cx"> vm, m_source, Identifier(), JSParserBuiltinMode::NotBuiltin,
</span><del>- JSParserStrictMode::NotStrict, JSParserCodeType::Program, error);
</del><ins>+ JSParserStrictMode::NotStrict, SourceParseMode::ProgramMode, error);
</ins><span class="cx"> if (programNode)
</span><span class="cx"> return 0;
</span><span class="cx"> ASSERT(error.isValid());
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceJavaScriptCoretestsstressmodulessyntaxerrorwithnamesjs"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/tests/stress/modules-syntax-error-with-names.js (188462 => 188463)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/tests/stress/modules-syntax-error-with-names.js        2015-08-14 11:33:44 UTC (rev 188462)
+++ releases/WebKitGTK/webkit-2.10/Source/JavaScriptCore/tests/stress/modules-syntax-error-with-names.js        2015-08-14 11:46:08 UTC (rev 188463)
</span><span class="lines">@@ -187,8 +187,13 @@
</span><span class="cx"> checkModuleSyntaxError(String.raw`
</span><span class="cx"> export default 20;
</span><span class="cx"> export default function hello () { }
</span><del>-`, `SyntaxError: Cannot export 'default' name twice..:4`);
</del><ins>+`, `SyntaxError: Only one 'default' export is allowed.:4`);
</ins><span class="cx">
</span><ins>+checkModuleSyntaxError(String.raw`
+export default function hello () { }
+export default 20;
+`, `SyntaxError: Only one 'default' export is allowed.:4`);
+
</ins><span class="cx"> // FIXME: These tests also should be passed. But now, var and lexical declared names can be co-exist on Script / Module top level scope.
</span><span class="cx"> // This will be fixed when this issue is fixed for Script environment.
</span><span class="cx"> // http://www.ecma-international.org/ecma-262/6.0/#sec-scripts-static-semantics-early-errors
</span></span></pre>
</div>
</div>
</body>
</html>