When we are trying to convert a javascript date object to locale string through the Date.prototype.toLocaleString() the value returned is not right. Attached below is the snippet of code used to test this.
`
String script ="{ var contextVar = {}; var a = 5; b = a+5; let date = new Date(); contextVar.obj3 = date.toLocaleString('en-US', 'Australia/Brisbane') }";
Context context = null;
try {
context = Context.newBuilder().allowHostAccess(HostAccess.ALL).build();
Value jsBindings = context.getBindings("js");
Source source = Source.newBuilder("js",script,null).build();
Value val = context.eval(source);
Value contextVarVal = jsBindings.getMember("contextVar");
System.err.println(contextVarVal);
} finally {
if(context != null) {
context.close();
}
}
`
When we are trying to convert a javascript date object to locale string through the Date.prototype.toLocaleString() the value returned is not right. Attached below is the snippet of code used to test this. `
This is with graals version 20.1.0.