You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally filed by morten.barklund on 2010-01-06T10:22:16
What steps will reproduce the problem?
1a. var s:String = ""\u0040 "";
1b. var s:String = ""\u0040"";
1c. var s:String = ""\u004"";
2. new JSONDecoder(s,false).getValue()
What is the expected output?
1a. "@ "
1b. "@"
1c. JSONParseError: Unexpected end of input. Expecting 4 hex digits after \u.
What do you see instead?
1a. "@ "
1b. JSONParseError: Unexpected end of input. Expecting 4 hex digits after \u.
1c. JSONParseError: Unexpected end of input. Expecting 4 hex digits after \u.
Would you be willing to submit a patch that contains the unit test to demonstrate the behavior, as well as the
correction to the line of code you indicated about?
The new unit test should show that scenario 1b is currently failing, and then after making the change to the
tokenizer the test (and all other pre-existing tests) should pass.
This test should fail currently. I do not have Flex Builder nor FlexUnit, so I cannot
verify with the proper setup. But if I write:
JSON.decode( ""\u0061"" )
It throws a runtime-error at me, so that test should definitely fail in any setup.
Could you please execute this test in your local setup? Maybe there is a problem with
the test-case not catching the error properly, and thus it seems like the whole
test-case works as it never asserts some false.
But in fact the function testDecodeStringWithInvalidUnicodeEscape throws an error.
Originally filed by morten.barklund on 2010-01-06T10:22:16
What steps will reproduce the problem?
1a. var s:String = ""\u0040 "";
1b. var s:String = ""\u0040"";
1c. var s:String = ""\u004"";
2. new JSONDecoder(s,false).getValue()
What is the expected output?
1a. "@ "
1b. "@"
1c. JSONParseError: Unexpected end of input. Expecting 4 hex digits after \u.
What do you see instead?
1a. "@ "
1b. JSONParseError: Unexpected end of input. Expecting 4 hex digits after \u.
1c. JSONParseError: Unexpected end of input. Expecting 4 hex digits after \u.
There error is the ">=" in line 339 of JSONTokenizer in current head:
http://code.google.com/p/as3corelib/source/browse/trunk/src/com/adobe/serialization/json/JSONTokenizer.as#339
Change it to ">" and the expected results occur instead of the unexpected
error-containing results.
The text was updated successfully, but these errors were encountered: