Class PrivateFieldAddNode

java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.js.nodes.JavaScriptBaseNode
com.oracle.truffle.js.nodes.access.PrivateFieldAddNode
All Implemented Interfaces:
com.oracle.truffle.api.nodes.NodeInterface, Cloneable

public abstract class PrivateFieldAddNode extends JavaScriptBaseNode
Adds a private field with a private name to a JS object (an instance of a JS class). Throws a TypeError if the object already has a private field with the same name.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.oracle.truffle.api.nodes.Node

    com.oracle.truffle.api.nodes.Node.Child, com.oracle.truffle.api.nodes.Node.Children
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    abstract void
    execute(Object target, Object key, Object value)
    Adds a new private field to the target object.

    Methods inherited from class com.oracle.truffle.js.nodes.JavaScriptBaseNode

    copy, getJSContext, getLanguage, getLanguageOptions, getRealm, hasOverloadedOperators, onReplace

    Methods inherited from class com.oracle.truffle.api.nodes.Node

    accept, adoptChildren, atomic, atomic, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, getSourceSection, insert, insert, isAdoptable, isSafelyReplaceableBy, notifyInserted, replace, replace, reportPolymorphicSpecialize, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PrivateFieldAddNode

      public PrivateFieldAddNode()
  • Method Details

    • create

      public static PrivateFieldAddNode create()
    • execute

      public abstract void execute(Object target, Object key, Object value)
      Adds a new private field to the target object.
      Parameters:
      target - the target object
      key - a private name
      value - the initial value of the added field