Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(semantic): document the meaning of ReferenceFlags::Read and Write #7368

Merged
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
24 changes: 23 additions & 1 deletion crates/oxc_syntax/src/reference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,31 @@ bitflags! {
#[cfg_attr(feature = "serialize", derive(Serialize))]
pub struct ReferenceFlags: u8 {
const None = 0;
/// A symbol is being read as a Value
/// A symbol is being read as a Value.
///
/// This value can be derived from the spec:
///
/// Under `Runtime Semantics: Evaluation`, when [`GetValue`](https://tc39.es/ecma262/#sec-getvalue) is called
/// on a expression, and the expression is an `IdentifierReference`.
///
/// For example:
/// ```text
/// 1. Let lRef be ? Evaluation of Expression.
/// 2. Perform ? GetValue(lRef).
/// ```
const Read = 1 << 0;
/// A symbol is being written to in a Value context.
///
/// This value can be derived from the spec:
///
/// Under `Runtime Semantics: Evaluation`, when [`PutValue`](https://tc39.es/ecma262/#sec-putvalue) is called
/// on a expression, and the expression is an `IdentifierReference`.
///
/// For example:
/// ```text
/// 1. Let lhs be ? Evaluation of LeftHandSideExpression.
/// 2. Perform ? PutValue(lhs, newValue).
/// ```
const Write = 1 << 1;
/// Used in type definitions.
const Type = 1 << 2;
Expand Down
Loading