Quote property names in object literals produced by toSource() if they
coincide with reserved keywords. git-svn-id: svn://10.0.0.236/trunk@156428 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -516,7 +516,7 @@ public class ScriptRuntime {
|
||||
if (!Character.isJavaIdentifierPart(s.charAt(i)))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return !TokenStream.isKeyword(s);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -123,7 +123,12 @@ public class TokenStream
|
||||
return "";
|
||||
}
|
||||
|
||||
private int stringToKeyword(String name) {
|
||||
static boolean isKeyword(String s)
|
||||
{
|
||||
return Token.EOF != stringToKeyword(s);
|
||||
}
|
||||
|
||||
private static int stringToKeyword(String name) {
|
||||
// #string_id_map#
|
||||
// The following assumes that Token.EOF == 0
|
||||
final int
|
||||
|
||||
Reference in New Issue
Block a user