Skip to content

Commit

Permalink
Merge f7a164e into f5d332c
Browse files Browse the repository at this point in the history
  • Loading branch information
Razican committed Apr 18, 2020
2 parents f5d332c + f7a164e commit c212135
Show file tree
Hide file tree
Showing 20 changed files with 3,597 additions and 2,394 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 c212135

Please sign in to comment.