Skip to content

Commit

Permalink
chore(ecmascript): Align PropertyKey discriminants with Value
Browse files Browse the repository at this point in the history
  • Loading branch information
aapoalas committed Oct 31, 2023
1 parent c9ce9d4 commit 4eeb0f1
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions nova_vm/src/ecmascript/types/language/object/property_key.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
use crate::{
ecmascript::{
execution::Agent,
types::{String, Value},
types::{
language::value::{
INTEGER_DISCRIMINANT, SMALL_STRING_DISCRIMINANT, STRING_DISCRIMINANT,
SYMBOL_DISCRIMINANT,
},
String, Value,
},
},
heap::{
indexes::{StringIndex, SymbolIndex},
Expand All @@ -11,11 +17,12 @@ use crate::{
};

#[derive(Debug, Clone, Copy, PartialEq)]
#[repr(u8)]
pub enum PropertyKey {
Integer(SmallInteger),
SmallString(SmallString),
String(StringIndex),
Symbol(SymbolIndex),
Integer(SmallInteger) = INTEGER_DISCRIMINANT,
SmallString(SmallString) = SMALL_STRING_DISCRIMINANT,
String(StringIndex) = STRING_DISCRIMINANT,
Symbol(SymbolIndex) = SYMBOL_DISCRIMINANT,
}

impl PropertyKey {
Expand Down

0 comments on commit 4eeb0f1

Please sign in to comment.