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

Feature SyntaxError #536

Merged
merged 5 commits into from
Jul 2, 2020
Merged

Feature SyntaxError #536

merged 5 commits into from
Jul 2, 2020

Conversation

HalidOdat
Copy link
Member

@HalidOdat HalidOdat commented Jun 28, 2020

It changes the following:

  • Implement SyntaxError object
  • Add .construct_syntax_error() and .throw_syntax_error()
  • Made error objects construction use to_string() (spec compliant and some cleanup)
  • Fix missing name field in prototype of error objects

@HalidOdat HalidOdat added enhancement New feature or request builtins PRs and Issues related to builtins/intrinsics labels Jun 28, 2020
@codecov
Copy link

codecov bot commented Jun 28, 2020

Codecov Report

Merging #536 into master will decrease coverage by 0.05%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #536      +/-   ##
==========================================
- Coverage   68.10%   68.05%   -0.06%     
==========================================
  Files         169      170       +1     
  Lines        9942     9957      +15     
==========================================
+ Hits         6771     6776       +5     
- Misses       3171     3181      +10     
Impacted Files Coverage Δ
boa/src/builtins/error/mod.rs 33.33% <0.00%> (+5.33%) ⬆️
boa/src/builtins/mod.rs 21.42% <0.00%> (-0.80%) ⬇️
boa/src/exec/exception.rs 56.00% <0.00%> (-14.00%) ⬇️
boa/src/builtins/error/syntax.rs 36.36% <36.36%> (ø)
boa/src/builtins/error/range.rs 59.09% <100.00%> (+3.09%) ⬆️
boa/src/builtins/error/reference.rs 59.09% <100.00%> (+3.09%) ⬆️
boa/src/builtins/error/type.rs 59.09% <100.00%> (+3.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b40e9e...6708820. Read the comment docs.

@github-actions
Copy link

Benchmark for f21deb2

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 605.1±37.25ns 605.9±38.22ns -0.13%
Array access (Execution) 14.8±0.95µs 14.2±0.60µs +4.23%
Array creation (Execution) 3.9±0.22ms 3.9±0.21ms 0.00%
Array pop (Execution) 1439.6±144.30µs 1420.5±72.38µs +1.34%
Boolean Object Access (Execution) 5.7±0.32µs 5.7±0.41µs 0.00%
Create Realm 160.0±11.25µs 144.5±15.54µs +10.73%
Dynamic Object Property Access (Execution) 7.9±0.61µs 7.8±0.45µs +1.28%
Expression (Lexer) 2.2±0.12µs 2.3±0.18µs -4.35%
Expression (Parser) 5.1±0.32µs 5.1±0.31µs 0.00%
Fibonacci (Execution) 1137.6±58.75µs 1119.4±50.79µs +1.63%
For loop (Execution) 26.5±2.11µs 24.0±0.77µs +10.42%
For loop (Lexer) 5.5±0.22µs 5.6±0.33µs -1.79%
For loop (Parser) 14.4±0.69µs 15.0±1.70µs -4.00%
Hello World (Lexer) 1021.4±69.12ns 1013.4±65.97ns +0.79%
Hello World (Parser) 2.4±0.26µs 2.4±0.16µs 0.00%
Long file (Parser) 6.7±0.30ms 6.7±0.19ms 0.00%
Number Object Access (Execution) 4.4±0.23µs 4.6±0.30µs -4.35%
Object Creation (Execution) 6.7±0.38µs 6.8±0.43µs -1.47%
RegExp (Execution) 82.9±4.93µs 81.4±4.97µs +1.84%
RegExp Literal (Execution) 87.6±5.21µs 87.7±5.26µs -0.11%
RegExp Literal Creation (Execution) 84.4±5.66µs 83.5±7.58µs +1.08%
Static Object Property Access (Execution) 7.0±0.38µs 7.0±0.46µs 0.00%
String Object Access (Execution) 9.7±0.78µs 9.6±0.57µs +1.04%
String comparison (Execution) 7.7±0.49µs 7.5±0.34µs +2.67%
String concatenation (Execution) 6.2±0.33µs 6.3±0.47µs -1.59%
String copy (Execution) 5.0±0.27µs 5.1±0.26µs -1.96%
Symbols (Execution) 4.7±0.45µs 4.5±0.36µs +4.44%

Copy link
Member

@Razican Razican left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just a couple of comments about the documentation :)

boa/src/builtins/error/mod.rs Outdated Show resolved Hide resolved
@Razican Razican added this to the v0.10.0 milestone Jun 30, 2020
@HalidOdat HalidOdat requested a review from Razican July 1, 2020 09:32
@github-actions
Copy link

github-actions bot commented Jul 1, 2020

Benchmark for 89fd802

Click to view benchmark
Test PR Benchmark Master Benchmark %
Arithmetic operations (Execution) 574.4±5.88ns 576.2±8.33ns -0.31%
Array access (Execution) 14.4±0.40µs 14.3±0.17µs +0.70%
Array creation (Execution) 4.0±0.05ms 4.0±0.05ms 0.00%
Array pop (Execution) 1535.8±42.14µs 1523.3±26.26µs +0.82%
Boolean Object Access (Execution) 5.3±0.09µs 5.4±0.05µs -1.85%
Create Realm 151.8±2.30µs 142.6±2.76µs +6.45%
Dynamic Object Property Access (Execution) 7.5±0.35µs 7.3±0.11µs +2.74%
Expression (Lexer) 2.2±0.02µs 2.2±0.03µs 0.00%
Expression (Parser) 5.2±0.06µs 5.2±0.12µs 0.00%
Fibonacci (Execution) 1031.8±22.21µs 1050.8±61.22µs -1.81%
For loop (Execution) 24.0±0.42µs 23.9±0.44µs +0.42%
For loop (Lexer) 5.6±0.08µs 5.6±0.06µs 0.00%
For loop (Parser) 14.1±0.30µs 14.1±0.72µs 0.00%
Hello World (Lexer) 1008.2±21.07ns 1012.0±18.63ns -0.38%
Hello World (Parser) 2.3±0.04µs 2.3±0.08µs 0.00%
Long file (Parser) 6.3±0.13ms 6.3±0.06ms 0.00%
Number Object Access (Execution) 4.4±0.31µs 4.3±0.09µs +2.33%
Object Creation (Execution) 6.4±0.08µs 6.4±0.08µs 0.00%
RegExp (Execution) 76.8±0.93µs 75.8±3.52µs +1.32%
RegExp Literal (Execution) 80.9±1.59µs 78.9±1.29µs +2.53%
RegExp Literal Creation (Execution) 76.9±1.45µs 76.1±3.18µs +1.05%
Static Object Property Access (Execution) 6.7±0.09µs 6.6±0.17µs +1.52%
String Object Access (Execution) 9.1±0.15µs 9.1±0.24µs 0.00%
String comparison (Execution) 7.4±0.30µs 7.1±0.10µs +4.23%
String concatenation (Execution) 6.1±0.17µs 6.0±0.09µs +1.67%
String copy (Execution) 4.8±0.05µs 4.7±0.11µs +2.13%
Symbols (Execution) 4.3±0.06µs 4.2±0.08µs +2.38%

@HalidOdat HalidOdat merged commit 070b78c into master Jul 2, 2020
@HalidOdat HalidOdat deleted the feature/syntaxerror branch July 2, 2020 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builtins PRs and Issues related to builtins/intrinsics enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants