Skip to content

Commit

Permalink
Update boa/src/syntax/ast/op.rs
Browse files Browse the repository at this point in the history
Co-Authored-By: HalidOdat <halidodat@gmail.com>
  • Loading branch information
jasonwilliams and HalidOdat authored Mar 24, 2020
1 parent 580690e commit a92e81f
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions boa/src/syntax/ast/op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,31 @@ pub enum UnaryOp {
TypeOf,
/// `...a` - spread an iterable value
Spread,
/// Delete
/// The JavaScript `delete` operator removes a property from an object.
///
/// Unlike what common belief suggests, the delete operator has nothing to do with
/// directly freeing memory. Memory management is done indirectly via breaking references.
/// If no more references to the same property are held, it is eventually released automatically.
///
/// The `delete` operator returns `true` for all cases except when the property is an
/// [own](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty)
/// [non-configurable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_delete)
/// property, in which case, `false` is returned in non-strict mode.
///
/// For more information, please check: <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete>
Delete,
/// Void

/// The `void` operator evaluates the given `expression` and then returns `undefined`.
///
/// This operator allows evaluating expressions that produce a value into places where an
/// expression that evaluates to `undefined` is desired.
/// The `void` operator is often used merely to obtain the `undefined` primitive value, usually using `void(0)`
/// (which is equivalent to `void 0`). In these cases, the global variable undefined can be used.
///
/// When using an [immediately-invoked function expression](https://developer.mozilla.org/en-US/docs/Glossary/IIFE),
/// `void` can be used to force the function keyword to be treated as an expression instead of a declaration.
///
/// For more information, please check: <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/void>
Void,
}

Expand Down

0 comments on commit a92e81f

Please sign in to comment.