kahntang / as3corelib

Automatically exported from code.google.com/p/as3corelib
0 stars 0 forks source link

JSONParseError raised in JSONParseError.as has 'name' key commented out. #31

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Pass a broken json string to a Flex app using corelib.as (import
com.adobe.serialization.json.JSON;)
2. Walk through the parsing in your favorite debugger.
3. If the parser breaks it will enter into JSONParseError.as and attempt to
define a JSONParseError.  The name key is commented out.

See line 60 in JSONParseError.as

Here is the source code:

public function JSONParseError( message:String = "", location:int = 0,
text:String = "") 
{
  super( message );
  //name = "JSONParseError";
  _location = location;
  _text = text;
}

What is the expected output? What do you see instead?
In flex I would like to catch the error using error.name, I can't do this
with the field commented out.

What version of the product are you using? On what operating system?
as3corelib

Please provide any additional information below.

Original issue reported on code.google.com by ingalls....@gmail.com on 4 Aug 2007 at 5:13

Attachments:

GoogleCodeExporter commented 9 years ago
Further investigation make me think this isn't a defect.  It seems that the 
flex error
returns 

com.adobe.serialization.json.JSONParseError$ (@4fc80b51)

This is difficult to use in a switch statement.  In any regard JSONParseError 
isn't
being raised.

Original comment by ingalls....@gmail.com on 4 Aug 2007 at 5:23

GoogleCodeExporter commented 9 years ago
This has been fixed in the source.

Original comment by mikechambers on 2 Jul 2008 at 5:05