Unicode Decoding in String/Char Literal Evaluation#113
Unicode Decoding in String/Char Literal Evaluation#113morris821028 wants to merge 27 commits intopejobo:v2.1from morris821028:master
Conversation
Improve error message for method invocation on null.
…g a script without local member declaration
…to string, and can not be successfully retrieved by outer layers
corrected junit library version number in eclipse .classpath file Fix provided by Andrea Curtoni
|
Thanks for making a pull request! This reminds me to add a "code of conduct", still on my buckt list :( Two things before I proceed:
Another thing - do you know this repro: https://github.com/beanshell/beanshell? |
| public void parse_unicode_literals_in_comment() throws Exception { | ||
| final Interpreter interpreter = new Interpreter(); | ||
| Object result = interpreter.eval("// source path: C:\\user\\desktop"); | ||
| Assert.assertEquals(result, null); |
| Object result = interpreter.eval("// source path: C:\\user\\desktop"); | ||
| Assert.assertEquals(result, null); | ||
| char c = (char) interpreter.eval("return '\\u51ea\'"); | ||
| Assert.assertEquals(c, '\u51ea'); |
| Assert.assertEquals(c, '\u51ea'); | ||
| String s = (String) interpreter.eval("return \"\\u51EA1234\"; // \\user\\desktop"); | ||
| System.out.println(s); | ||
| Assert.assertEquals(s, "\u51EA1234"); |
There was a problem hiding this comment.
Test case three (dedicated method)
|
Yeah, I know the repo https://github.com/beanshell/beanshell . Therefore, I also opened the issue about it. There are many enhancement in other repo than this one. But, this one has a large version number of release product. I don't know what this repo has, but anthoer don't. Our product uses 2.1.x version, so there is a problem to update. Althrough @stain, @nickl- , etc. fixed some bugs in their repo, I prefer this repo to work with Eclipse IDE. It has more convenient to develop, experiment and build. If all of you can decide how to merge into a repository, and create a complete environment for build flow and introduce what's kind of IDE you used, it will be more maintainers I think. |
|
Maybe we should limit some syntax problem. Please look at https://stackoverflow.com/questions/30727515/why-is-executing-java-code-in-comments-with-certain-unicode-characters-allowed |
|
Superseded by #114 |
|
@morris821028 pong! Missed this thread but perhaps #110 is more appropriate for a response from me. @pejobo please see response there... |
This patch is used to avoid the content of comment make it failed in parser. According to #112 , there is a solution which move the unicode decode part of
readchar()intostringSetupandcharSetup.