Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
HalidOdat committed Aug 19, 2020
1 parent d0e8b03 commit 6e8e634
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
15 changes: 10 additions & 5 deletions boa/examples/classes.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
use boa::builtins::object::{Class, ClassBuilder};
use boa::builtins::value::*;
use boa::exec::*;
use boa::realm::Realm;
use boa::*;
use boa::{
builtins::{
object::{Class, ClassBuilder},
value::Value,
},
exec::Interpreter,
forward_val,
realm::Realm,
Result,
};

use gc::{Finalize, Trace};

Expand Down
2 changes: 1 addition & 1 deletion boa/src/builtins/object/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub trait Class: NativeObject + Sized {
/// The amount of arguments the class `constructor` takes, default is `0`.
const LENGTH: usize = 0;
/// The attibutes the class will be binded with, default is `writable`, `enumerable`, `configurable`.
const ATTRIBUTE: Attribute = Attribute::ALL;
const ATTRIBUTE: Attribute = Attribute::all();

/// The constructor of the class.
fn constructor(this: &Value, args: &[Value], ctx: &mut Interpreter) -> Result<Self>;
Expand Down
6 changes: 0 additions & 6 deletions boa/src/builtins/property/attribute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ bitflags! {
/// Additionaly there are flags for when the flags are defined.
#[derive(Finalize)]
pub struct Attribute: u8 {
/// None of the flags are present.
const NONE = 0b0000_0000;

/// All the flags set (`WRITABLE`, `ENUMERABLE`, `CONFIGURABLE`).
const ALL = 0b0011_1111;

/// The `Writable` attribute decides whether the value associated with the property can be changed or not, from its initial value.
const WRITABLE = 0b0000_0011;

Expand Down
2 changes: 1 addition & 1 deletion boa/src/builtins/property/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl Property {
#[inline]
pub fn empty() -> Self {
Self {
attribute: Attribute::NONE,
attribute: Attribute::empty(),
value: None,
get: None,
set: None,
Expand Down

0 comments on commit 6e8e634

Please sign in to comment.