diff --git a/Cargo.lock b/Cargo.lock index 1c900f41..0ec720c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -420,17 +420,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "dash_core" -version = "0.3.0" -dependencies = [ - "bitflags 1.3.2", - "dash_proc_macro", - "derive_more", - "strum", - "strum_macros", -] - [[package]] name = "dash_decompiler" version = "0.1.0" @@ -562,7 +551,6 @@ name = "dash_rt" version = "0.3.0" dependencies = [ "dash_compiler", - "dash_core", "dash_middle", "dash_optimizer", "dash_proc_macro", @@ -2159,7 +2147,6 @@ version = "0.1.0" dependencies = [ "anyhow", "clap", - "dash_core", "dash_optimizer", "dash_vm", "once_cell", diff --git a/Cargo.toml b/Cargo.toml index f0cdaf00..17b20e96 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,6 @@ members = [ "crates/dash_compiler", "crates/dash_optimizer", "crates/dash_vm", - "crates/dash_core", "cli", "testrunner", "crates/dash_regex", diff --git a/crates/dash_vm/src/js_std/array.rs b/crates/dash_vm/src/js_std/array.rs index b2248d63..6d394ba2 100644 --- a/crates/dash_vm/src/js_std/array.rs +++ b/crates/dash_vm/src/js_std/array.rs @@ -105,7 +105,7 @@ pub fn every(cx: CallContext) -> Result { for k in 0..len { let pk = cx.scope.intern_usize(k); let pkv = this.get_property(cx.scope, pk.into()).root(cx.scope)?; - let args = vec![pkv, Value::number(k as f64)]; + let args = vec![pkv, Value::number(k as f64), this.clone()]; let test = callback .apply(cx.scope, Value::undefined(), args) .root(cx.scope)? @@ -127,7 +127,7 @@ pub fn some(cx: CallContext) -> Result { for k in 0..len { let pk = cx.scope.intern_usize(k); let pkv = this.get_property(cx.scope, pk.into()).root(cx.scope)?; - let args = vec![pkv, Value::number(k as f64)]; + let args = vec![pkv, Value::number(k as f64), this.clone()]; let test = callback .apply(cx.scope, Value::undefined(), args) .root(cx.scope)? @@ -167,7 +167,7 @@ pub fn filter(cx: CallContext) -> Result { for k in 0..len { let pk = cx.scope.intern_usize(k); let pkv = this.get_property(cx.scope, pk.into()).root(cx.scope)?; - let args = vec![pkv.clone(), Value::number(k as f64)]; + let args = vec![pkv.clone(), Value::number(k as f64), this.clone()]; let test = callback .apply(cx.scope, Value::undefined(), args) .root(cx.scope)? @@ -208,7 +208,7 @@ pub fn reduce(cx: CallContext) -> Result { for k in start..len { let pk = cx.scope.intern_usize(k); let pkv = this.get_property(cx.scope, pk.into()).root(cx.scope)?; - let args = vec![accumulator, pkv, Value::number(k as f64)]; + let args = vec![accumulator, pkv, Value::number(k as f64), this.clone()]; accumulator = callback.apply(cx.scope, Value::undefined(), args).root(cx.scope)?; } @@ -223,7 +223,7 @@ pub fn find(cx: CallContext) -> Result { for k in 0..len { let pk = cx.scope.intern_usize(k); let pkv = this.get_property(cx.scope, pk.into()).root(cx.scope)?; - let args = vec![pkv.clone(), Value::number(k as f64)]; + let args = vec![pkv.clone(), Value::number(k as f64), this.clone()]; let test = callback .apply(cx.scope, Value::undefined(), args) .root(cx.scope)? @@ -245,7 +245,7 @@ pub fn find_index(cx: CallContext) -> Result { for k in 0..len { let pk = cx.scope.intern_usize(k); let pkv = this.get_property(cx.scope, pk.into()).root(cx.scope)?; - let args = vec![pkv, Value::number(k as f64)]; + let args = vec![pkv, Value::number(k as f64), this.clone()]; let test = callback .apply(cx.scope, Value::undefined(), args) .root(cx.scope)? @@ -271,7 +271,7 @@ pub fn for_each(cx: CallContext) -> Result { for k in 0..len { let pk = cx.scope.intern_usize(k); let pkv = this.get_property(cx.scope, pk.into()).root(cx.scope)?; - let args = vec![pkv, Value::number(k as f64)]; + let args = vec![pkv, Value::number(k as f64), this.clone()]; callback.apply(cx.scope, Value::undefined(), args).root_err(cx.scope)?; } @@ -367,7 +367,7 @@ pub fn map(cx: CallContext) -> Result { for k in 0..len { let pk = cx.scope.intern_usize(k); let pkv = this.get_property(cx.scope, pk.into()).root(cx.scope)?; - let args = vec![pkv.clone(), Value::number(k as f64)]; + let args = vec![pkv.clone(), Value::number(k as f64), this.clone()]; let value = callback.apply(cx.scope, Value::undefined(), args).root(cx.scope)?; values.push(PropertyValue::static_default(value));