Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
aapoalas committed Dec 8, 2024
1 parent 9a134ab commit 69b4ca2
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions nova_vm/src/ecmascript/builtins/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,7 @@ impl InternalMethods for Module {
)
}))
}
// TODO: Check this but it should not be possible to export any
// integer-valued names.
PropertyKey::Integer(_) => Ok(false),
PropertyKey::SmallString(_) | PropertyKey::String(_) => {
PropertyKey::Integer(_) | PropertyKey::SmallString(_) | PropertyKey::String(_) => {
// 2. Let current be ? O.[[GetOwnProperty]](P).
let current = self.internal_get_own_property(agent, gc, property_key)?;
// 3. If current is undefined, return false.
Expand Down Expand Up @@ -498,14 +495,14 @@ impl InternalMethods for Module {
ordinary_get(agent, gc.reborrow(), object, property_key, receiver).unwrap()
}))
}
PropertyKey::Integer(_) => Ok(Value::Undefined),
PropertyKey::SmallString(_) | PropertyKey::String(_) => {
PropertyKey::Integer(_) | PropertyKey::SmallString(_) | PropertyKey::String(_) => {
// 2. Let exports be O.[[Exports]].
let exports: &[String] = &agent[self].exports;
let key = match property_key {
PropertyKey::SmallString(data) => String::SmallString(data),
PropertyKey::String(data) => String::String(data),
PropertyKey::Integer(_) | PropertyKey::Symbol(_) => unreachable!(),
PropertyKey::Integer(_) => todo!(),
_ => unreachable!(),
};
let exports_contains_p = exports.contains(&key);
// 3. If exports does not contain P, return undefined.
Expand Down Expand Up @@ -578,11 +575,11 @@ impl InternalMethods for Module {
ordinary_delete(agent, gc, object, property_key)
}))
}
PropertyKey::Integer(_) => Some(false),
PropertyKey::SmallString(_) | PropertyKey::String(_) => {
PropertyKey::Integer(_) | PropertyKey::SmallString(_) | PropertyKey::String(_) => {
let p = match property_key {
PropertyKey::String(data) => String::String(data),
PropertyKey::SmallString(data) => String::SmallString(data),
PropertyKey::Integer(_) => todo!(),
_ => unreachable!(),
};
// 2. Let exports be O.[[Exports]].
Expand Down

0 comments on commit 69b4ca2

Please sign in to comment.