Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions nova_cli/src/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ use nova_vm::{
},
scripts_and_modules::script::{parse_script, script_evaluation},
types::{
BigInt, Function, InternalMethods, IntoValue, Number, Object, OrdinaryObject,
PropertyDescriptor, PropertyKey, String, Value,
BigInt, Function, InternalMethods, Number, Object, OrdinaryObject, PropertyDescriptor,
PropertyKey, String, Value,
},
},
engine::{
Expand Down Expand Up @@ -185,7 +185,7 @@ pub fn initialize_global_object(agent: &mut Agent, global: Object, gc: GcScope)
return Err(agent.throw_exception(ExceptionType::Error, e.to_string(), gc));
}
};
Ok(String::from_string(agent, file, gc).into_value())
Ok(String::from_string(agent, file, gc).into())
}

// 'now' function
Expand All @@ -197,7 +197,7 @@ pub fn initialize_global_object(agent: &mut Agent, global: Object, gc: GcScope)
) -> JsResult<'gc, Value<'gc>> {
let nanos = START_TIME.elapsed().as_nanos();
let bigint = BigInt::from_u128(agent, nanos, gc.into_nogc());
Ok(bigint.into_value())
Ok(bigint.into())
}

let function = create_builtin_function(
Expand Down Expand Up @@ -291,7 +291,7 @@ fn monotonic_now<'gc>(
let micros = ((START_TIME.elapsed().as_micros() as u16 % 1000) / 5 * 5) as f64 / 1000.0;
let total = millis + micros;
let number = Number::from_f64(agent, total, gc);
Ok(number.into_value())
Ok(number.into())
}

fn create_obj_func(
Expand Down Expand Up @@ -337,7 +337,7 @@ pub fn initialize_global_object_with_internals(agent: &mut Agent, global: Object
Some(initialize_global_object_with_internals),
gc,
);
Ok(realm.global_object(agent).into_value().unbind())
Ok(realm.global_object(agent).unbind().into())
}

/// `detachArrayBuffer` function
Expand Down Expand Up @@ -660,7 +660,7 @@ fn initialize_child_global_object(agent: &mut Agent, global: Object, mut gc: GcS

let _ = cb
.unbind()
.call(agent, Value::Null, &mut [sab.into_value().unbind()], gc);
.call(agent, Value::Null, &mut [sab.unbind().into()], gc);

Ok(Value::Undefined)
}
Expand Down Expand Up @@ -726,7 +726,7 @@ fn initialize_child_global_object(agent: &mut Agent, global: Object, mut gc: GcS
agent,
property_key,
PropertyDescriptor {
value: Some(test262_obj.into_value()),
value: Some(test262_obj.into()),
writable: Some(true),
enumerable: Some(false),
configurable: Some(true),
Expand All @@ -742,7 +742,7 @@ fn initialize_child_global_object(agent: &mut Agent, global: Object, mut gc: GcS
agent,
property_key,
PropertyDescriptor {
value: Some(agent_obj.into_value()),
value: Some(agent_obj.into()),
writable: Some(true),
enumerable: Some(false),
configurable: Some(true),
Expand Down
2 changes: 1 addition & 1 deletion nova_cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ enum Command {
#[arg(short, long)]
module: bool,

/// Sets the [[CanBlock]] value of the Agent Record to false.
/// Sets the \[\[CanBlock]] value of the Agent Record to false.
#[arg(long)]
no_block: bool,

Expand Down
3 changes: 2 additions & 1 deletion nova_vm/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ const fn get_index(n: &'static str) -> usize {
struct_const.push_str(string);
struct_const.push_str("\") }),\n");
} else {
struct_const.push_str(": String::String(HeapString(BaseIndex::from_index(get_index(");
struct_const
.push_str(": String::String(HeapString(BaseIndex::from_index_const(get_index(");
struct_const.push_str(&format!("\"{string}\")))),\n"));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ use crate::{
Agent, JsResult,
agent::{ExceptionType, JsError, try_result_into_option_js},
},
types::{
BUILTIN_STRING_MEMORY, Function, IntoObject, IntoValue, Object, OrdinaryObject,
PropertyKey, Value,
},
types::{BUILTIN_STRING_MEMORY, Function, Object, OrdinaryObject, PropertyKey, Value},
},
engine::{
ScopableCollection, ScopedCollection, VmIteratorRecord,
Expand All @@ -39,7 +36,7 @@ use crate::{
/// An Iterator Record is a Record value used to encapsulate an Iterator or
/// AsyncIterator along with the next method.
#[derive(Debug, Clone, Copy)]
pub struct IteratorRecord<'a> {
pub(crate) struct IteratorRecord<'a> {
pub(crate) iterator: Object<'a>,
pub(crate) next_method: Function<'a>,
// Note: The done field doesn't seem to be used anywhere.
Expand Down Expand Up @@ -492,7 +489,7 @@ pub(crate) fn iterator_close_with_value<'a>(
call_function(
agent,
return_function.unbind(),
iterator.into_value().unbind(),
iterator.unbind().into(),
None,
gc.reborrow(),
)
Expand Down Expand Up @@ -566,7 +563,7 @@ pub(crate) fn iterator_close_with_error<'a>(
let _ = call_function(
agent,
r#return.unbind(),
iterator.into_value().unbind(),
iterator.unbind().into(),
None,
gc.reborrow(),
);
Expand Down Expand Up @@ -622,7 +619,7 @@ pub(crate) fn create_iter_result_object<'a>(
.current_realm_record()
.intrinsics()
.object_prototype()
.into_object(),
.into(),
),
&[
ObjectEntry {
Expand All @@ -637,7 +634,7 @@ pub(crate) fn create_iter_result_object<'a>(
ObjectEntry {
key: PropertyKey::from(BUILTIN_STRING_MEMORY.done),
value: ObjectEntryPropertyDescriptor::Data {
value: done.into_value(),
value: done.into(),
writable: true,
enumerable: true,
configurable: true,
Expand Down
Loading