Skip to content

Commit

Permalink
Feature/number object (#182)
Browse files Browse the repository at this point in the history
* Feature(Number): Tests for the Test Driven Development!

refs #34

* Feature: Skeleton code for Number

refs #34

* Feature: Most of Number() is complete

Includes:
- make_number()
- call_number()
- Number().toExponential()
- Number().toFixed()
- Number().toLocaleString() (ish)
- Number().toString()
- Number().valueOf()
- create_constructor()
- init()

Missing:
- Number().toPrecision()

refs #34

* Feature(Number): test compatability with const -> var

I don't have all the context on _why_ but all of the tests for `Number` started failing.

Upon investigation it was becuase `const` stopped acting the way I expected.
Switching my test cases from using `const` to using `var` variable declarations
made everything work again.  I don't know enough about JS to know if this is a
bug or expected behavior.  Based on changes to other tests, it is know
behavior.

Refs #34

* Changelog: Number() object.

Includes some clippy fixes.

Fixes #34
  • Loading branch information
pop authored and jasonwilliams committed Nov 6, 2019
1 parent 064ecd9 commit d725b0c
Show file tree
Hide file tree
Showing 8 changed files with 426 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*.iml

# Vim
.*.swp
.*.swo
*.*.swp
*.*.swo

# Build
target
Expand All @@ -16,4 +16,4 @@ yarn-error.log
.vscode/settings.json

# tests/js/test.js is used for testing changes locally
test/js/test.js
tests/js/test.js
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ Feature enhancements:
Implement Array.prototype.fill() (@bojan88)
- Array tests: Tests implemented for shift, unshift and reverse, pop and push (@muskuloes)
- Demo page has been improved, new font plus change on input. Thanks @WofWca
- [FEATURE #182](https://github.com/jasonwilliams/boa/pull/182):
Implement some Number prototype methods (incl tests) (@pop)

Bug fixes:

Expand Down
2 changes: 2 additions & 0 deletions src/lib/builtins/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ pub mod function;
pub mod json;
/// The global `Math` object
pub mod math;
/// The global `Number` object
pub mod number;
/// The global `Object` object
pub mod object;
/// The global 'RegExp' object
Expand Down
Loading

0 comments on commit d725b0c

Please sign in to comment.