protected function constructJSInstance()

in src/XHPJSInstance.php [23:39]


  protected function constructJSInstance(string $module, mixed ...$args): void {
    $instances = $this->getContext('x_js_scope/instances', null);
    invariant(
      $instances is ScriptDataList,
      'Can not use constructJSInstance unless x_js_scope is an ancestor in tree',
    );
    $instances->append(tuple(
      $this->getID(),
      $module,
      Vec\map(
        $args,
        $arg ==>
          /* HHAST_FIXME[NamespacePrivate] Fix when picking a namespace for this project */
          _Private\to_js_value($arg),
      ),
    ));
  }