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

Buggy neg int dump in not dec style #399

Closed
puzrin opened this issue Feb 18, 2018 · 0 comments
Closed

Buggy neg int dump in not dec style #399

puzrin opened this issue Feb 18, 2018 · 0 comments
Assignees
Labels

Comments

@puzrin
Copy link
Member

puzrin commented Feb 18, 2018

represent: {
binary: function (object) { return '0b' + object.toString(2); },
octal: function (object) { return '0' + object.toString(8); },
decimal: function (object) { return object.toString(10); },
hexadecimal: function (object) { return '0x' + object.toString(16).toUpperCase(); }
},

  • now: -10 -> 0b-1010
  • should be: -10 -> -0b1010

The same for octal & hex.

Reference: #398 (comment)

@puzrin puzrin added the bug label Feb 18, 2018
@puzrin puzrin closed this as completed in dc2227b Mar 5, 2018
minj added a commit to minj/js-yaml that referenced this issue Apr 28, 2018
* master: (58 commits)
  Check for leading newlines when determining if block indentation indicator is needed (nodeca#404)
  Add property based tests to assess load reverses dump (nodeca#398)
  3.11.0 released
  Browser files rebuild
  Dumper: fix negative integers in bin/octal/hex formats, close nodeca#399
  support es6 arrow functions, fixes nodeca#389 (nodeca#393)
  Fix typo in README.md (nodeca#373)
  3.10.0 released
  Browser files rebuild
  Add test for astrals dump
  Combine surrogate pairs into one escape sequence when encoding. (nodeca#369)
  Fix condenseFlow for objects (nodeca#371)
  correct spelling mistake (nodeca#367)
  More meaningful error for loader (nodeca#361)
  Fix typo and format code. (nodeca#365)
  3.9.1 released
  Browser files rebuild
  Ensure stack is present for custom errors (fixes nodeca#351) (nodeca#360)
  3.9.0 released
  Browser files rebuild
  ...
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