xref: /third_party/node/test/addons/new-target/test.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/addons/new-target/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_ciconst common = require('../../common');
41cb0ef41Sopenharmony_ciconst assert = require('assert');
51cb0ef41Sopenharmony_ciconst binding = require(`./build/${common.buildType}/binding`);
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ciclass Class extends binding.Class {
81cb0ef41Sopenharmony_ci  constructor() {
91cb0ef41Sopenharmony_ci    super();
101cb0ef41Sopenharmony_ci    this.method();
111cb0ef41Sopenharmony_ci  }
121cb0ef41Sopenharmony_ci  method() {
131cb0ef41Sopenharmony_ci    this.ok = true;
141cb0ef41Sopenharmony_ci  }
151cb0ef41Sopenharmony_ci}
161cb0ef41Sopenharmony_ci
171cb0ef41Sopenharmony_ciassert.ok(new Class() instanceof binding.Class);
181cb0ef41Sopenharmony_ciassert.ok(new Class().ok);
19

Indexes created Thu Nov 07 10:32:03 CST 2024