Skip to content

Commit

Permalink
move ValueConversions to common mod, commit rustfmt.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
y21 committed Dec 23, 2023
1 parent afd8c9c commit e4a83bf
Show file tree
Hide file tree
Showing 35 changed files with 35 additions and 33 deletions.
2 changes: 1 addition & 1 deletion crates/dash_dlloader/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use dash_vm::throw;
use dash_vm::value::function::native::CallContext;
use dash_vm::value::function::{Function, FunctionKind};
use dash_vm::value::object::{NamedObject, Object, PropertyValue};
use dash_vm::value::ops::abstractions::conversions::ValueConversion;
use dash_vm::value::ops::conversions::ValueConversion;
use dash_vm::value::Value;
use libloading::Library;

Expand Down
2 changes: 1 addition & 1 deletion crates/dash_rt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use dash_vm::frame::{Exports, Frame};
use dash_vm::gc::persistent::Persistent;
use dash_vm::localscope::LocalScope;
use dash_vm::value::function::native::CallContext;
use dash_vm::value::ops::abstractions::conversions::ValueConversion;
use dash_vm::value::ops::conversions::ValueConversion;
use dash_vm::value::promise::Promise;
use dash_vm::value::{Root, Value};
use dash_vm::PromiseAction;
Expand Down
2 changes: 1 addition & 1 deletion crates/dash_rt_fs/src/promises.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use dash_vm::value::error::Error;
use dash_vm::value::function::native::CallContext;
use dash_vm::value::function::{Function, FunctionKind};
use dash_vm::value::object::{NamedObject, Object, PropertyKey, PropertyValue};
use dash_vm::value::ops::abstractions::conversions::ValueConversion;
use dash_vm::value::ops::conversions::ValueConversion;
use dash_vm::value::{Value, ValueContext};

pub fn init_module(sc: &mut LocalScope) -> Result<Value, Value> {
Expand Down
2 changes: 1 addition & 1 deletion crates/dash_rt_fs/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use dash_vm::value::error::Error;
use dash_vm::value::function::native::CallContext;
use dash_vm::value::function::{Function, FunctionKind};
use dash_vm::value::object::{NamedObject, Object, PropertyKey, PropertyValue};
use dash_vm::value::ops::abstractions::conversions::ValueConversion;
use dash_vm::value::ops::conversions::ValueConversion;
use dash_vm::value::{Value, ValueContext};

pub fn init_module(sc: &mut LocalScope) -> Result<Value, Value> {
Expand Down
2 changes: 1 addition & 1 deletion crates/dash_rt_http/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use dash_vm::localscope::LocalScope;
use dash_vm::value::function::native::CallContext;
use dash_vm::value::function::{Function, FunctionKind};
use dash_vm::value::object::{NamedObject, Object, PropertyValue};
use dash_vm::value::ops::abstractions::conversions::ValueConversion;
use dash_vm::value::ops::conversions::ValueConversion;
use dash_vm::value::root_ext::RootErrExt;
use dash_vm::value::{Value, ValueContext};
use dash_vm::{delegate, throw};
Expand Down
2 changes: 1 addition & 1 deletion crates/dash_rt_net/src/listener/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use dash_vm::value::arraybuffer::ArrayBuffer;
use dash_vm::value::function::native::CallContext;
use dash_vm::value::function::{Function, FunctionKind};
use dash_vm::value::object::{NamedObject, Object, PropertyValue};
use dash_vm::value::ops::abstractions::conversions::ValueConversion;
use dash_vm::value::ops::conversions::ValueConversion;
use dash_vm::value::promise::Promise;
use dash_vm::value::{Unrooted, Value};
use dash_vm::{delegate, throw, PromiseAction};
Expand Down
2 changes: 1 addition & 1 deletion crates/dash_rt_timers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use dash_vm::throw;
use dash_vm::value::function::native::CallContext;
use dash_vm::value::function::{Function, FunctionKind};
use dash_vm::value::object::{NamedObject, Object, PropertyValue};
use dash_vm::value::ops::abstractions::conversions::ValueConversion;
use dash_vm::value::ops::conversions::ValueConversion;
use dash_vm::value::Value;

#[derive(Debug)]
Expand Down
2 changes: 1 addition & 1 deletion crates/dash_vm/src/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ mod handlers {
use crate::value::function::user::UserFunction;
use crate::value::function::{adjust_stack_from_flat_call, Function, FunctionKind};
use crate::value::object::{NamedObject, Object, ObjectMap, PropertyKey, PropertyValue, PropertyValueKind};
use crate::value::ops::abstractions::conversions::ValueConversion;
use crate::value::ops::conversions::ValueConversion;
use crate::value::ops::equality::ValueEquality;

use super::*;
Expand Down
2 changes: 1 addition & 1 deletion crates/dash_vm/src/js_std/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::throw;
use crate::value::array::{Array, ArrayIterator};
use crate::value::function::native::CallContext;
use crate::value::object::PropertyValue;
use crate::value::ops::abstractions::conversions::ValueConversion;
use crate::value::ops::conversions::ValueConversion;
use crate::value::ops::equality::ValueEquality;
use crate::value::root_ext::RootErrExt;
use crate::value::{array, Root, Value, ValueContext};
Expand Down
2 changes: 1 addition & 1 deletion crates/dash_vm/src/js_std/arraybuffer.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::throw;
use crate::value::arraybuffer::ArrayBuffer;
use crate::value::function::native::CallContext;
use crate::value::ops::abstractions::conversions::ValueConversion;
use crate::value::ops::conversions::ValueConversion;
use crate::value::Value;

pub fn constructor(cx: CallContext) -> Result<Value, Value> {
Expand Down
2 changes: 1 addition & 1 deletion crates/dash_vm/src/js_std/boolean.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::throw;
use crate::value::function::native::CallContext;
use crate::value::ops::abstractions::conversions::ValueConversion;
use crate::value::ops::conversions::ValueConversion;
use crate::value::{Value, ValueContext};

pub fn constructor(cx: CallContext) -> Result<Value, Value> {
Expand Down
2 changes: 1 addition & 1 deletion crates/dash_vm/src/js_std/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::value::error::{
AggregateError, Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, URIError,
};
use crate::value::function::native::CallContext;
use crate::value::ops::abstractions::conversions::ValueConversion;
use crate::value::ops::conversions::ValueConversion;
use crate::value::{Root, Value, ValueContext};

macro_rules! define_other_error_constructors {
Expand Down
2 changes: 1 addition & 1 deletion crates/dash_vm/src/js_std/global.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::value::function::native::CallContext;
use crate::value::ops::abstractions::conversions::ValueConversion;
use crate::value::ops::conversions::ValueConversion;
use crate::value::{Value, ValueContext};

#[rustfmt::skip]
Expand Down
2 changes: 1 addition & 1 deletion crates/dash_vm/src/js_std/json.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::value::function::native::CallContext;
use crate::value::ops::abstractions::conversions::ValueConversion;
use crate::value::ops::conversions::ValueConversion;
use crate::value::{Value, ValueContext};
use crate::{json, throw};

Expand Down
2 changes: 1 addition & 1 deletion crates/dash_vm/src/js_std/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::throw;
use crate::value::function::native::CallContext;
use crate::value::map::Map;
use crate::value::object::PropertyKey;
use crate::value::ops::abstractions::conversions::ValueConversion;
use crate::value::ops::conversions::ValueConversion;
use crate::value::{Root, Value, ValueContext};

pub fn constructor(cx: CallContext) -> Result<Value, Value> {
Expand Down
2 changes: 1 addition & 1 deletion crates/dash_vm/src/js_std/math.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::throw;
use crate::value::function::native::CallContext;
use crate::value::ops::abstractions::conversions::ValueConversion;
use crate::value::ops::conversions::ValueConversion;
use crate::value::{Value, ValueContext};

pub fn abs(cx: CallContext) -> Result<Value, Value> {
Expand Down
2 changes: 1 addition & 1 deletion crates/dash_vm/src/js_std/number.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::throw;
use crate::util::format_f64;
use crate::value::function::native::CallContext;
use crate::value::ops::abstractions::conversions::ValueConversion;
use crate::value::ops::conversions::ValueConversion;
use crate::value::primitive::{Number, MAX_SAFE_INTEGERF};
use crate::value::{Value, ValueContext};

Expand Down
2 changes: 1 addition & 1 deletion crates/dash_vm/src/js_std/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::throw;
use crate::value::array::Array;
use crate::value::function::native::CallContext;
use crate::value::object::{NamedObject, Object, PropertyKey, PropertyValue};
use crate::value::ops::abstractions::conversions::ValueConversion;
use crate::value::ops::conversions::ValueConversion;
use crate::value::root_ext::RootErrExt;
use crate::value::{Root, Value, ValueContext};

Expand Down
2 changes: 1 addition & 1 deletion crates/dash_vm/src/js_std/regex.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::throw;
use crate::value::function::native::CallContext;
use crate::value::ops::abstractions::conversions::ValueConversion;
use crate::value::ops::conversions::ValueConversion;
use crate::value::regex::RegExp;
use crate::value::{Value, ValueContext};
use dash_regex::matcher::Matcher as RegexMatcher;
Expand Down
2 changes: 1 addition & 1 deletion crates/dash_vm/src/js_std/set.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::throw;
use crate::value::function::native::CallContext;
use crate::value::object::PropertyKey;
use crate::value::ops::abstractions::conversions::ValueConversion;
use crate::value::ops::conversions::ValueConversion;
use crate::value::set::Set;
use crate::value::{Root, Value, ValueContext};

Expand Down
2 changes: 1 addition & 1 deletion crates/dash_vm/src/js_std/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::value::array::{Array, ArrayIterator};
use crate::value::boxed::String as BoxedString;
use crate::value::function::native::CallContext;
use crate::value::object::PropertyValue;
use crate::value::ops::abstractions::conversions::ValueConversion;
use crate::value::ops::conversions::ValueConversion;
use crate::value::{Value, ValueContext};
use std::borrow::Cow;
use std::fmt::Write;
Expand Down
2 changes: 1 addition & 1 deletion crates/dash_vm/src/js_std/symbol.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::value::function::native::CallContext;
use crate::value::ops::abstractions::conversions::ValueConversion;
use crate::value::ops::conversions::ValueConversion;
use crate::value::primitive::Symbol;
use crate::value::{Value, ValueContext};

Expand Down
2 changes: 1 addition & 1 deletion crates/dash_vm/src/js_std/typedarray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::throw;
use crate::value::arraybuffer::ArrayBuffer;
use crate::value::function::native::CallContext;
use crate::value::object::Object;
use crate::value::ops::abstractions::conversions::ValueConversion;
use crate::value::ops::conversions::ValueConversion;
use crate::value::typedarray::{TypedArray, TypedArrayKind};
use crate::value::Value;

Expand Down
2 changes: 1 addition & 1 deletion crates/dash_vm/src/value/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::localscope::LocalScope;
use crate::{delegate, throw, Vm};

use super::object::{NamedObject, Object, PropertyKey, PropertyValue, PropertyValueKind};
use super::ops::abstractions::conversions::ValueConversion;
use super::ops::conversions::ValueConversion;
use super::primitive::array_like_keys;
use super::{Root, Unrooted, Value};

Expand Down
2 changes: 1 addition & 1 deletion crates/dash_vm/src/value/boxed.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use super::ops::abstractions::conversions::{PreferredType, ValueConversion};
use super::ops::conversions::{PreferredType, ValueConversion};
use super::ops::equality::ValueEquality;
use crate::gc::handle::Handle;
use crate::localscope::LocalScope;
Expand Down
2 changes: 1 addition & 1 deletion crates/dash_vm/src/value/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::gc::handle::Handle;
use crate::localscope::LocalScope;
use crate::{throw, Vm};

use super::ops::abstractions::conversions::ValueConversion;
use super::ops::conversions::ValueConversion;
use super::primitive::{PrimitiveCapabilities, Symbol};
use super::{ExternalValue, Root, Typeof, Unrooted, Value, ValueContext};

Expand Down
1 change: 0 additions & 1 deletion crates/dash_vm/src/value/ops/abstractions/mod.rs

This file was deleted.

2 changes: 1 addition & 1 deletion crates/dash_vm/src/value/ops/arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::localscope::LocalScope;
use crate::value::object::Object;
use crate::value::{Typeof, Value};

use super::abstractions::conversions::ValueConversion;
use super::conversions::ValueConversion;
use super::equality::ValueEquality;

impl Value {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion crates/dash_vm/src/value/ops/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pub mod abstractions;
pub mod arithmetic;
pub mod conversions;
pub mod equality;
2 changes: 1 addition & 1 deletion crates/dash_vm/src/value/primitive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::util::format_f64;

use super::boxed::{Boolean as BoxedBoolean, Number as BoxedNumber, String as BoxedString, Symbol as BoxedSymbol};
use super::object::{Object, PropertyKey, PropertyValue};
use super::ops::abstractions::conversions::{PreferredType, ValueConversion};
use super::ops::conversions::{PreferredType, ValueConversion};
use super::ops::equality::ValueEquality;
use super::{Typeof, Unrooted, Value};

Expand Down
2 changes: 1 addition & 1 deletion crates/dash_vm/src/value/typedarray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::Vm;

use super::arraybuffer::ArrayBuffer;
use super::object::{NamedObject, Object, PropertyKey, PropertyValue};
use super::ops::abstractions::conversions::ValueConversion;
use super::ops::conversions::ValueConversion;
use super::{Root, Unrooted, Value};

#[derive(Debug, Copy, Clone)]
Expand Down
2 changes: 1 addition & 1 deletion crates/dash_wasm/src/jsvalue.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use dash_vm::value::object::PropertyValue;
use dash_vm::value::ops::abstractions::conversions::ValueConversion;
use dash_vm::value::ops::conversions::ValueConversion;
use dash_vm::value::{Typeof, Value as DashValue};
use wasm_bindgen::prelude::wasm_bindgen;

Expand Down
2 changes: 1 addition & 1 deletion crates/dash_wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use dash_parser::Parser;
use dash_vm::eval::EvalError;
use dash_vm::frame::Frame;
use dash_vm::params::VmParams;
use dash_vm::value::ops::abstractions::conversions::ValueConversion;
use dash_vm::value::ops::conversions::ValueConversion;
use dash_vm::value::Value;
use dash_vm::Vm;
use std::fmt::Write;
Expand Down
3 changes: 3 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
max_width = 120
edition = "2021"
imports_granularity = "Module"
version = "Two"

0 comments on commit e4a83bf

Please sign in to comment.