Giter Club home page Giter Club logo

actionjson's People

Contributors

mherkender avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

actionjson's Issues

1024 - stack underflow error?

Hi,

In my test suite I'm seeing stack underflow errors while decoding JSON (synchronous version):

"VerifyError: Error #1024: Stack underflow occurred."

Has anyone else seen this? I'm trying to put together a test case that will allow others to attempt to reproduce..

Decoding fails on multidimensional array

I'm running into problems decoding a GeoJSON string that as far as I can tell is valid JSON.

Here's the full JSON string I'm sending to the decoder:

{"type":"FeatureCollection","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::3857"}},"features":[{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-13483771.9163,4699077.70459],[-13485123.1123,4700163.02188],[-13490514.2039,4696563.11539],[-13483771.9163,4699077.70459]]]},"properties":{"id":"057","name":"Nevada"}}]}

The problem comes in the "coordinates" field, which is a multidimensional array of points. When I decode the JSON, the coordinates field is returned as the following string:

-13483771.9163,4699077.70459,-13485123.1123,4700163.02188,-13490514.2039,4696563.11539,-13483771.9163,4699077.70459

Any ideas?

Thanks much!

whitespace handling

Not sure if this is in your plan, but it would be nice if it could handle whitespace inside the json, ie:

{
"foo":"bar",
"baz":"boz"
}

Decoding of numbers in JsonDecoderAsync

There is an issue when decoding numbers in JsonDecoderAsync: I noticed that when there is some numeric value which is not at the end of the object, it is not stored correctly in the result. I tried with some basic objects to confirm it:

In the following example, number_b is correct but number_a is undefined.
{"number_a":1,"number_b":2}

In this one, only number_c is correct. number_a and number_b are undefined
{"number_a":1,"number_b":2,"number_c":3}

Apparently, the problem is that, in case 0x100, you first store the value of the number in "result" but then you only put it in the stack when you find a "}" character. I followed the execution of the program and confirmed that later, you just overwrite result and the value of those numbers is never saved.

I added the line of code that saves the value of the number to the case when there is a comma (instead of a "}" character) and it is working perfectly now. Here is the code, the line I added is the second one:

if (char === 0x2c) {// == ,
    _stack[_stack.length - 4][_stack[_stack.length - 3]] = result;
    _stack.pop();
    _stack[_stack.length - 1] = 0x304;
} else if (char === 0x7d) {// == }
    _stack[_stack.length - 4][_stack[_stack.length - 3]] = result;
    result = _stack[_stack.length - 4];
    _stack.length -= 4;
} else {
    throw new Error("Unexpected ] while parsing object");
}

Number encoding error.

You permit NaN, Infinity and -Infinity to pass through while all other libraries (and I do mean all) filter these values to null.

Also, you parse -Infinity but throw an error on the other two values mentioned, you may want to implement better syntax filtering.

what if object is IExternalizable

if an object should not be serialized with for in loop, but in a special way
e.g. ObjectProxy from mx.utils. It does not seem currect code counts that case

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.