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

Disassembler Bug for "numberValue"? — Otherwise comment likely needed. #48

Closed
CodeMan99 opened this issue Jan 8, 2019 · 1 comment
Assignees
Labels

Comments

@CodeMan99
Copy link

CodeMan99 commented Jan 8, 2019

In the Disassembler class, a packed number will be pushed with (javascript) type string.

{name: 'numberValue', value: number}

I am wondering if top should be used instead of number?

Otherwise, there should probably be a comment explaining why number is being pushed into the stream as a string value.

@CodeMan99 CodeMan99 changed the title Assembler Bug for "numberValue"? — Otherwise comment likely needed. Disassembler Bug for "numberValue"? — Otherwise comment likely needed. Jan 8, 2019
@uhop uhop self-assigned this Jan 8, 2019
@uhop uhop added the question label Jan 8, 2019
@uhop
Copy link
Owner

uhop commented Jan 8, 2019

The code is correct. A number is sent as a string to be compatible with the stream of tokens used by other components documented in

https://github.com/uhop/stream-json/wiki/Parser#stream-of-tokens

It is guaranteed to be a well-formed number as per the JSON standard.

@uhop uhop closed this as completed Jan 8, 2019
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

2 participants