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:
igor%mir2.org
2004-05-15 17:23:06 +00:00
parent 2ffefbf44b
commit 2250cd0546
2 changed files with 7 additions and 2 deletions

View File

@@ -516,7 +516,7 @@ public class ScriptRuntime {
if (!Character.isJavaIdentifierPart(s.charAt(i)))
return false;
}
return true;
return !TokenStream.isKeyword(s);
}
/**

View File

@@ -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