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

multivalue JSON broken? #222

Closed
dvv opened this issue May 15, 2012 · 1 comment
Closed

multivalue JSON broken? #222

dvv opened this issue May 15, 2012 · 1 comment
Labels
Milestone

Comments

@dvv
Copy link
Member

dvv commented May 15, 2012

local JSON = require('json')

--
-- multivalue JSON
--
do
  local status, results = pcall(
      JSON.parse,
      ('allow_multiple_values'):rep(10000),
      { allow_multiple_values = true }
    )
  p(status, results, #results)
  --assert(status)
  --assert(#results == 10000)
end

--
-- multivalue JSON
--
do
  local results = {}
  local parser = JSON.streamingParser(function (value)
    results[#result + 1] = value
  end, { allow_multiple_values = true })
  local status, result = pcall(parser.parse, parser, ('allow_multiple_values'):rep(10000))
  p(status, result, #results)
  --assert(status)
  --assert(#result == 10000)
end

fails with

dvv@dvv:~/projects/bench-suite$ luvit t.lua 
false   "/home/dvv/projects/luvit/lib/luvit/json.lua:107: lexical error: invalid char in json text.\n                                       allow_multiple_valuesallow_mult\n                     (right here) ------^\n"   204
false   "lexical error: invalid char in json text.\n                                       allow_multiple_valuesallow_mult\n                     (right here) ------^\n"    0

Once fixed, should be added to json test.

--Vladimir


Want to back this issue? Place a bounty on it! We accept bounties via Bountysource.

@rphillips rphillips added this to the v2.0.0 milestone Nov 28, 2014
@rphillips rphillips modified the milestones: v2.1.0, v2.0.0 Mar 10, 2015
@creationix
Copy link
Member

We are no longer using yajl bindings and multi-value json is not a feature of the new parser.

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

No branches or pull requests

3 participants