mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Fixing bug 309029: remind parser about Context.compileFunction case.
This commit is contained in:
parent
942745b2cd
commit
d3457ec733
@ -360,6 +360,22 @@ rethrown erro...</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<tr style="height: 12.75pt;" height="17">
|
||||
|
||||
<td class="xl26" style="height: 12.75pt; width: 48pt; text-align: left;" x:num="" height="17" width="64"><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=306825">306825</a></td>
|
||||
|
||||
<td class="xl25" style="width: 330pt;" width="440">Allow to use shell.Global in servlets</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<tr style="height: 12.75pt;" height="17">
|
||||
|
||||
<td class="xl26" style="height: 12.75pt; width: 48pt; text-align: left;" x:num="" height="17" width="64"><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=309029"></a>309029</td>
|
||||
|
||||
<td class="xl25" style="width: 330pt;" width="440">Exception when evaluating recursive function</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
@ -2182,6 +2182,9 @@ public class Context
|
||||
}
|
||||
|
||||
Parser p = new Parser(compilerEnv, compilationErrorReporter);
|
||||
if (returnFunction) {
|
||||
p.calledByCompileFunction = true;
|
||||
}
|
||||
ScriptOrFnNode tree;
|
||||
if (sourceString != null) {
|
||||
tree = p.parse(sourceString, sourceName, lineno);
|
||||
|
@ -68,6 +68,7 @@ public class Parser
|
||||
CompilerEnvirons compilerEnv;
|
||||
private ErrorReporter errorReporter;
|
||||
private String sourceURI;
|
||||
boolean calledByCompileFunction;
|
||||
|
||||
private TokenStream ts;
|
||||
private int currentFlaggedToken;
|
||||
@ -340,7 +341,9 @@ public class Parser
|
||||
if (tt == Token.FUNCTION) {
|
||||
consumeToken();
|
||||
try {
|
||||
n = function(FunctionNode.FUNCTION_STATEMENT);
|
||||
n = function(calledByCompileFunction
|
||||
? FunctionNode.FUNCTION_EXPRESSION
|
||||
: FunctionNode.FUNCTION_STATEMENT);
|
||||
} catch (ParserException e) {
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user