Skip to content

Commit

Permalink
Merge 05d3467 into 505df91
Browse files Browse the repository at this point in the history
  • Loading branch information
Razican committed Apr 16, 2020
2 parents 505df91 + 05d3467 commit d98538e
Show file tree
Hide file tree
Showing 23 changed files with 3,434 additions and 2,397 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion boa/benches/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fn symbol_creation(c: &mut Criterion) {
}

fn create_realm(c: &mut Criterion) {
c.bench_function("Create Realm", move |b| b.iter(|| Realm::create()));
c.bench_function("Create Realm", move |b| b.iter(Realm::create));
}

criterion_group!(benches, create_realm, symbol_creation);
Expand Down
12 changes: 6 additions & 6 deletions boa/src/builtins/object/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ impl ObjectInternalMethods for Object {
impl Object {
/// Return a new ObjectData struct, with `kind` set to Ordinary
pub fn default() -> Self {
let mut object = Object {
let mut object = Self {
kind: ObjectKind::Ordinary,
internal_slots: Box::new(HashMap::new()),
properties: Box::new(HashMap::new()),
Expand All @@ -289,8 +289,8 @@ impl Object {
///
/// https://tc39.es/ecma262/#sec-objectcreate
// TODO: proto should be a &Value here
pub fn create(proto: Value) -> Object {
let mut obj = Object::default();
pub fn create(proto: Value) -> Self {
let mut obj = Self::default();
obj.internal_slots
.insert(INSTANCE_PROTOTYPE.to_string(), proto);
obj.internal_slots
Expand All @@ -312,7 +312,7 @@ impl Object {

/// Return a new Boolean object whose [[BooleanData]] internal slot is set to argument.
fn from_boolean(argument: &Value) -> Self {
let mut obj = Object {
let mut obj = Self {
kind: ObjectKind::Boolean,
internal_slots: Box::new(HashMap::new()),
properties: Box::new(HashMap::new()),
Expand All @@ -327,7 +327,7 @@ impl Object {

/// Return a new Number object whose [[NumberData]] internal slot is set to argument.
fn from_number(argument: &Value) -> Self {
let mut obj = Object {
let mut obj = Self {
kind: ObjectKind::Number,
internal_slots: Box::new(HashMap::new()),
properties: Box::new(HashMap::new()),
Expand All @@ -342,7 +342,7 @@ impl Object {

/// Return a new String object whose [[StringData]] internal slot is set to argument.
fn from_string(argument: &Value) -> Self {
let mut obj = Object {
let mut obj = Self {
kind: ObjectKind::String,
internal_slots: Box::new(HashMap::new()),
properties: Box::new(HashMap::new()),
Expand Down
Loading

0 comments on commit d98538e

Please sign in to comment.