Skip to content

Commit

Permalink
Merge aa47eda into 48ab045
Browse files Browse the repository at this point in the history
  • Loading branch information
Razican authored Apr 11, 2020
2 parents 48ab045 + aa47eda commit 661469a
Show file tree
Hide file tree
Showing 18 changed files with 2,609 additions and 2,075 deletions.
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 661469a

Please sign in to comment.