Hi,
Thanks for reporting these issues. Filed a bug and fix for obj."prop"
http://hg.openjdk.java.net/jdk9/dev/nashorn/rev/7e06231229fd
Filed a bug for anon-func-inside-with issue
https://bugs.openjdk.java.net/browse/JDK-8114838
Rest being code clean up issues, we'll piggyback with other fixes.
Thanks again!
-Sundar
On Tuesday 16 June 2015 09:26 PM, Andreas Woess wrote:
Dear Nashorn team,
I'd like to bring a few very minor implementation bugs to your
attention (proper JS programs are not affected).
obj."prop"
obj.'prop'
should be a SyntaxError, but is not in Nashorn. (even with -nse)
Parser.java:719 #program
final Block programBody = new Block(functionToken, functionLine,
body.getFlags() | Block.IS_SYNTHETIC, body.getStatements());
s/functionLine/finish/
Parser.java:497 #createFunctionNode
Token.descPosition(body.getToken()),
Supplied finish parameter to new FunctionNode is
Token.descPosition(body.getToken()). I'd have expected the finish of
the body to be passed here.
ScriptObject.java:402
public final boolean isGenericDescriptor() {
return isAccessorDescriptor() || isDataDescriptor();
}
This method returns the opposite of what the standard describes.
Actually it's unused.
A follow-up bug on JDK-8056123:
with({}){ /*force vars into scope*/
function () { /*line 2*/
print("hello from nashorn");
}
}
print(this["L:2"]); // print function on line 2
expected: undefined
actual: function ...
I wonder if there's a particular reason for having the assignment (var
L:2 = function ...) in the AST in the first place.
and finally, BooleanType.java: duplicate license header
Version: some recent jdk9/dev/nashorn revision.
- andreas