Skip to content

Commit

Permalink
Move object module to root (#689)
Browse files Browse the repository at this point in the history
  • Loading branch information
HalidOdat authored Sep 8, 2020
1 parent 79da43a commit efd9ab8
Show file tree
Hide file tree
Showing 29 changed files with 666 additions and 632 deletions.
2 changes: 1 addition & 1 deletion boa/src/builtins/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mod tests;

use super::function::{make_builtin_fn, make_constructor_fn};
use crate::{
builtins::object::{ObjectData, PROTOTYPE},
object::{ObjectData, PROTOTYPE},
property::{Attribute, Property},
value::{same_value_zero, Value},
BoaProfiler, Context, Result,
Expand Down
6 changes: 2 additions & 4 deletions boa/src/builtins/bigint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@
//! [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt

use crate::{
builtins::{
function::{make_builtin_fn, make_constructor_fn},
object::ObjectData,
},
builtins::function::{make_builtin_fn, make_constructor_fn},
object::ObjectData,
value::{RcBigInt, Value},
BoaProfiler, Context, Result,
};
Expand Down
2 changes: 1 addition & 1 deletion boa/src/builtins/boolean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
mod tests;

use super::function::{make_builtin_fn, make_constructor_fn};
use crate::{builtins::object::ObjectData, BoaProfiler, Context, Result, Value};
use crate::{object::ObjectData, BoaProfiler, Context, Result, Value};

/// Boolean implementation.
#[derive(Debug, Clone, Copy)]
Expand Down
6 changes: 2 additions & 4 deletions boa/src/builtins/date/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
mod tests;

use crate::{
builtins::{
function::{make_builtin_fn, make_constructor_fn},
object::ObjectData,
},
builtins::function::{make_builtin_fn, make_constructor_fn},
object::ObjectData,
value::{PreferredType, Value},
BoaProfiler, Context, Result,
};
Expand Down
2 changes: 1 addition & 1 deletion boa/src/builtins/date/tests.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![allow(clippy::zero_prefixed_literal)]

use crate::{builtins::object::ObjectData, forward, forward_val, Context, Value};
use crate::{forward, forward_val, object::ObjectData, Context, Value};
use chrono::prelude::*;

// NOTE: Javascript Uses 0-based months, where chrono uses 1-based months. Many of the assertions look wrong because of
Expand Down
6 changes: 2 additions & 4 deletions boa/src/builtins/error/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
//! [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error

use crate::{
builtins::{
function::{make_builtin_fn, make_constructor_fn},
object::ObjectData,
},
builtins::function::{make_builtin_fn, make_constructor_fn},
object::ObjectData,
profiler::BoaProfiler,
Context, Result, Value,
};
Expand Down
3 changes: 2 additions & 1 deletion boa/src/builtins/error/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
//! [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError

use crate::{
builtins::{function::make_builtin_fn, function::make_constructor_fn, object::ObjectData},
builtins::{function::make_builtin_fn, function::make_constructor_fn},
object::ObjectData,
profiler::BoaProfiler,
Context, Result, Value,
};
Expand Down
3 changes: 2 additions & 1 deletion boa/src/builtins/error/reference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
//! [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError

use crate::{
builtins::{function::make_builtin_fn, function::make_constructor_fn, object::ObjectData},
builtins::{function::make_builtin_fn, function::make_constructor_fn},
object::ObjectData,
profiler::BoaProfiler,
Context, Result, Value,
};
Expand Down
3 changes: 2 additions & 1 deletion boa/src/builtins/error/syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
//! [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError

use crate::{
builtins::{function::make_builtin_fn, function::make_constructor_fn, object::ObjectData},
builtins::{function::make_builtin_fn, function::make_constructor_fn},
object::ObjectData,
profiler::BoaProfiler,
Context, Result, Value,
};
Expand Down
3 changes: 2 additions & 1 deletion boa/src/builtins/error/type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
//! [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError

use crate::{
builtins::{function::make_builtin_fn, function::make_constructor_fn, object::ObjectData},
builtins::{function::make_builtin_fn, function::make_constructor_fn},
object::ObjectData,
BoaProfiler, Context, Result, Value,
};

Expand Down
6 changes: 2 additions & 4 deletions boa/src/builtins/function/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
//! [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function

use crate::{
builtins::{
object::{Object, ObjectData, PROTOTYPE},
Array,
},
builtins::Array,
environment::lexical_environment::Environment,
object::{Object, ObjectData, PROTOTYPE},
property::{Attribute, Property},
syntax::ast::node::{FormalParameter, RcStatementList},
BoaProfiler, Context, Result, Value,
Expand Down
2 changes: 1 addition & 1 deletion boa/src/builtins/json/tests.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{builtins::object::PROTOTYPE, forward, forward_val, value::same_value, Context};
use crate::{forward, forward_val, object::PROTOTYPE, value::same_value, Context};

#[test]
fn json_sanity() {
Expand Down
2 changes: 1 addition & 1 deletion boa/src/builtins/map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use super::function::{make_builtin_fn, make_constructor_fn};
use crate::{
builtins::object::{ObjectData, PROTOTYPE},
object::{ObjectData, PROTOTYPE},
property::{Attribute, Property},
BoaProfiler, Context, Result, Value,
};
Expand Down
3 changes: 2 additions & 1 deletion boa/src/builtins/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pub(crate) use self::{
math::Math,
nan::NaN,
number::Number,
object::Object,
regexp::RegExp,
string::String,
symbol::Symbol,
Expand All @@ -47,7 +48,7 @@ pub fn init(interpreter: &mut Context) {
let globals = [
// The `Function` global must be initialized before other types.
function::init,
object::init,
Object::init,
Array::init,
BigInt::init,
Boolean::init,
Expand Down
6 changes: 2 additions & 4 deletions boa/src/builtins/number/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@
//! [spec]: https://tc39.es/ecma262/#sec-number-object
//! [mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number

use super::{
function::{make_builtin_fn, make_constructor_fn},
object::ObjectData,
};
use super::function::{make_builtin_fn, make_constructor_fn};
use crate::{
object::ObjectData,
value::{AbstractRelation, Value},
BoaProfiler, Context, Result,
};
Expand Down
Loading

0 comments on commit efd9ab8

Please sign in to comment.