Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser fails for non-object, non-array inputs #60

Open
fulldecent opened this issue Mar 13, 2019 · 1 comment
Open

Parser fails for non-object, non-array inputs #60

fulldecent opened this issue Mar 13, 2019 · 1 comment

Comments

@fulldecent
Copy link

Test case

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>Clarinet</title>
    <script type="text/javascript">var exports = {};</script>
    <script type="text/javascript" src="../clarinet.js"></script>
    <script type="text/javascript">
    var parser = exports.parser();
    parser.onvalue = function (v) {
      console.log("Value: " + v);
    };
    parser.onkey = function (key) {
      console.log("Key: " + key);
    };
    parser.write('1').close();
    </script>
</script>
</head>
<body>
  Look at the console.
</body>
</html>

Expected outcome

parser.onvalue is called

Actual outcome

Error: Non-whitespace before {[.
Line: 1
Column: 1
Char: 49

Discussion

JSON now allows 123 as a legal value. If clarinet only supports the older version of JSON where this was not legal, then please update the documentation.

@corno
Copy link

corno commented Feb 4, 2020

in my fork (bass-clarinet), this is fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants