Skip to content

Commit

Permalink
chore: fix typos (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
lino-levan authored Oct 31, 2023
1 parent 2da3eaa commit e456e19
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion nova_vm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ ECMAScript specification text and its structure.

As an example, the `ecmascript/types` folder corresponds to the specification's
section 6, `ECMAScript Data Types and Values`. That section has two subsections,
6.1 `ECMASCript Language Types` and 6.2 `ECMAScript Specification Types`, which
6.1 `ECMAScript Language Types` and 6.2 `ECMAScript Specification Types`, which
then correspond to the `ecmascript/types/language` and `ecmascript/types/spec`
folders respectively.
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ pub(crate) fn to_number(agent: &mut Agent, argument: Value) -> JsResult<Number>

/// ### [7.1.5 ToIntegerOrInfinity ( argument )](https://tc39.es/ecma262/#sec-tointegerorinfinity)
// TODO: Should we add another [`Value`] newtype for IntegerOrInfinity?
pub(crate) fn to_integer_or_infinty(agent: &mut Agent, argument: Value) -> JsResult<Number> {
pub(crate) fn to_integer_or_infinity(agent: &mut Agent, argument: Value) -> JsResult<Number> {
// 1. Let number be ? ToNumber(argument).
let number = to_number(agent, argument)?;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl PrivateEnvironmentIndex {
pub enum PrivateElement {
Field(Option<Value>),
Method(Option<Function>),
/// Accssor(get, set)
/// Accessor(get, set)
Accessor(Option<Function>, Option<Function>),
}

Expand Down
6 changes: 3 additions & 3 deletions nova_vm/src/heap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ good idea of the data and common actions on it.

So what are common actions that a JavaScript runtime does?

- There's all the boring stuff like arithemtic operations, boolean logic, etc.
- There's all the boring stuff like arithmetic operations, boolean logic, etc.
- Creating objects and arrays is very common.
- Checking for properties in an object is very common.
- Object access is very common.
Expand All @@ -28,11 +28,11 @@ What are some uncommon actions?
- Deleting of object properties. It is done, yes, but rarely do you see objects
used as hashmaps anymore.
- Accessing or defining property descriptors.
- Accessing or assinging non-element (indexed) properties on arrays.
- Accessing or assigning non-element (indexed) properties on arrays.
- Calling getter or setter functions. This happens but again is not the most
common path.
- Checking the length of a function.
- Accessing or assigning propertes on functions. This does happen, but it is
- Accessing or assigning properties on functions. This does happen, but it is
infrequent.
- Accessing or assigning properties on ArrayBuffers, Uint8Arrays, DataViews,
Dates, RegExps, ... Most builtin objects are used for their named purpose only
Expand Down
18 changes: 9 additions & 9 deletions nova_vm/src/heap/element_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ impl ElementArrays {
&mut self,
key: ElementArrayKey,
vector: Vec<Option<Value>>,
desciptors: Option<HashMap<u32, ElementDescriptor>>,
descriptors: Option<HashMap<u32, ElementDescriptor>>,
) -> ElementIndex {
match key {
ElementArrayKey::E4 => {
Expand All @@ -558,7 +558,7 @@ impl ElementArrays {
self.e2pow4.values.set_len(self.e2pow4.values.len() + 1);
}
let index = ElementIndex::last(&self.e2pow4.values);
if let Some(descriptors) = desciptors {
if let Some(descriptors) = descriptors {
self.e2pow4.descriptors.insert(index, descriptors);
}
index
Expand All @@ -580,7 +580,7 @@ impl ElementArrays {
self.e2pow6.values.set_len(self.e2pow6.values.len() + 1);
}
let index = ElementIndex::last(&self.e2pow6.values);
if let Some(descriptors) = desciptors {
if let Some(descriptors) = descriptors {
self.e2pow6.descriptors.insert(index, descriptors);
}
index
Expand All @@ -602,7 +602,7 @@ impl ElementArrays {
self.e2pow8.values.set_len(self.e2pow8.values.len() + 1);
}
let index = ElementIndex::last(&self.e2pow8.values);
if let Some(descriptors) = desciptors {
if let Some(descriptors) = descriptors {
self.e2pow8.descriptors.insert(index, descriptors);
}
index
Expand All @@ -624,7 +624,7 @@ impl ElementArrays {
self.e2pow10.values.set_len(self.e2pow10.values.len() + 1);
}
let index = ElementIndex::last(&self.e2pow10.values);
if let Some(descriptors) = desciptors {
if let Some(descriptors) = descriptors {
self.e2pow10.descriptors.insert(index, descriptors);
}
index
Expand All @@ -646,7 +646,7 @@ impl ElementArrays {
self.e2pow12.values.set_len(self.e2pow12.values.len() + 1);
}
let index = ElementIndex::last(&self.e2pow12.values);
if let Some(descriptors) = desciptors {
if let Some(descriptors) = descriptors {
self.e2pow12.descriptors.insert(index, descriptors);
}
index
Expand All @@ -668,7 +668,7 @@ impl ElementArrays {
self.e2pow16.values.set_len(self.e2pow16.values.len() + 1);
}
let index = ElementIndex::last(&self.e2pow16.values);
if let Some(descriptors) = desciptors {
if let Some(descriptors) = descriptors {
self.e2pow16.descriptors.insert(index, descriptors);
}
index
Expand All @@ -690,7 +690,7 @@ impl ElementArrays {
self.e2pow24.values.set_len(self.e2pow24.values.len() + 1);
}
let index = ElementIndex::last(&self.e2pow24.values);
if let Some(descriptors) = desciptors {
if let Some(descriptors) = descriptors {
self.e2pow24.descriptors.insert(index, descriptors);
}
index
Expand All @@ -712,7 +712,7 @@ impl ElementArrays {
self.e2pow32.values.set_len(self.e2pow32.values.len() + 1);
}
let index = ElementIndex::last(&self.e2pow32.values);
if let Some(descriptors) = desciptors {
if let Some(descriptors) = descriptors {
self.e2pow32.descriptors.insert(index, descriptors);
}
index
Expand Down

0 comments on commit e456e19

Please sign in to comment.