Skip to content

Commit

Permalink
Merge 463285d into 2851eb0
Browse files Browse the repository at this point in the history
  • Loading branch information
Razican authored May 12, 2020
2 parents 2851eb0 + 463285d commit fdcdf09
Show file tree
Hide file tree
Showing 66 changed files with 2,144 additions and 1,455 deletions.
23 changes: 11 additions & 12 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [

{
"type": "lldb",
"request": "launch",
Expand Down Expand Up @@ -37,16 +36,16 @@
"symbolSearchPath": "https://msdl.microsoft.com/download/symbols"
},
{
"name": "(Windows) Run Test Debugger",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/target/debug/boa-ea5ed1ef3ee0cbe1.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"preLaunchTask": "Cargo Test Build",
}
"name": "(Windows) Run Test Debugger",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/target/debug/boa-ea5ed1ef3ee0cbe1.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"preLaunchTask": "Cargo Test Build",
}
]
}
32 changes: 15 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions boa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ exclude = ["../.vscode/*", "../Dockerfile", "../Makefile", "../.editorConfig"]
edition = "2018"

[dependencies]
gc = { version = "0.3.4", features = ["derive"] }
serde_json = "1.0.52"
gc = { version = "0.3.4", features = ["derive"], git = "https://github.com/Razican/rust-gc.git", branch = "box_str" }
serde_json = "1.0.53"
rand = "0.7.3"
num-traits = "0.2.11"
regex = "1.3.7"
rustc-hash = "1.1.0"

# Optional Dependencies
serde = { version = "1.0.106", features = ["derive"], optional = true }
serde = { version = "1.0.110", features = ["derive"], optional = true }

[dev-dependencies]
criterion = "0.3.2"
Expand Down
16 changes: 9 additions & 7 deletions boa/src/builtins/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,17 @@ use crate::{
},
exec::Interpreter,
};
use std::borrow::Borrow;
use std::cmp::{max, min};
use std::ops::Deref;
use std::{
borrow::Borrow,
cmp::{max, min},
ops::Deref,
};

/// Creates a new `Array` instance.
pub(crate) fn new_array(interpreter: &Interpreter) -> ResultValue {
let array = Value::new_object(Some(
&interpreter
.get_realm()
.realm()
.environment
.get_global_object()
.expect("Could not get global object"),
Expand All @@ -37,7 +39,7 @@ pub(crate) fn new_array(interpreter: &Interpreter) -> ResultValue {
array.borrow().set_internal_slot(
INSTANCE_PROTOTYPE,
interpreter
.get_realm()
.realm()
.environment
.get_binding_value("Array")
.borrow()
Expand Down Expand Up @@ -541,7 +543,7 @@ pub fn map(this: &mut Value, args: &[Value], interpreter: &mut Interpreter) -> R

let length = i32::from(&this.get_field_slice("length"));

let new = new_array(&interpreter)?;
let new = new_array(interpreter)?;

let values: Vec<Value> = (0..length)
.map(|idx| {
Expand Down Expand Up @@ -879,7 +881,7 @@ pub fn filter(this: &mut Value, args: &[Value], interpreter: &mut Interpreter) -

let length = i32::from(&this.get_field_slice("length"));

let new = new_array(&interpreter)?;
let new = new_array(interpreter)?;

let values = (0..length)
.filter_map(|idx| {
Expand Down
Loading

0 comments on commit fdcdf09

Please sign in to comment.