Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException on empty for loop #645

Closed
luisggpina opened this issue Jan 23, 2020 · 2 comments
Closed

NullPointerException on empty for loop #645

luisggpina opened this issue Jan 23, 2020 · 2 comments
Labels
bug Issues considered a bug Ecma Incompatibility Issues about Rhino being incompatible with the EcmaScript spec

Comments

@luisggpina
Copy link

Input:

for(({});;){  }

Error output:

Exception in thread "main" java.lang.NullPointerException
	at org.mozilla.javascript.optimizer.BodyCodegen.visitObjectLiteral(Codegen.java:3232)
	at org.mozilla.javascript.optimizer.BodyCodegen.generateExpression(Codegen.java:2351)
	at org.mozilla.javascript.optimizer.BodyCodegen.generateStatement(Codegen.java:2058)
	at org.mozilla.javascript.optimizer.BodyCodegen.generateStatement(Codegen.java:1878)
	at org.mozilla.javascript.optimizer.BodyCodegen.generateStatement(Codegen.java:1878)
	at org.mozilla.javascript.optimizer.BodyCodegen.generateBodyCode(Codegen.java:1300)
	at org.mozilla.javascript.optimizer.Codegen.generateCode(Codegen.java:319)
	at org.mozilla.javascript.optimizer.Codegen.compileToClassFile(Codegen.java:194)
	at org.mozilla.javascript.optimizer.Codegen.compile(Codegen.java:103)
	at org.mozilla.javascript.Context.compileImpl(Context.java:2530)
	at org.mozilla.javascript.Context.compileString(Context.java:1525)
	at org.mozilla.javascript.Context.compileString(Context.java:1514)

Affects: Version 1.7.13 and current master (3d3679d)

@p-bakker p-bakker added the bug Issues considered a bug label Jun 30, 2021
@p-bakker p-bakker added the Ecma Incompatibility Issues about Rhino being incompatible with the EcmaScript spec label Oct 14, 2021
@rbri
Copy link
Collaborator

rbri commented Dec 1, 2024

Have done a test cases for this in #1744.

I think we can close this if the pr #1744 is merged.

@rbri
Copy link
Collaborator

rbri commented Dec 2, 2024

#1744 is merged.

Thanks @luisggpina for bringing this up.

@rbri rbri closed this as completed Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues considered a bug Ecma Incompatibility Issues about Rhino being incompatible with the EcmaScript spec
Projects
None yet
Development

No branches or pull requests

3 participants