mirror of
https://github.com/nodejs/node.git
synced 2025-05-04 20:09:32 +00:00

The convention for js-native-api/<test_name>: * <test_name>.c or <test_name>.cc has the entry point * The name of the target is <test_name> PR-URL: https://github.com/nodejs/node/pull/38692 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
22 lines
506 B
JavaScript
22 lines
506 B
JavaScript
'use strict';
|
|
|
|
const common = require('../../common');
|
|
const assert = require('assert');
|
|
const binding = require(`./build/${common.buildType}/test_new_target`);
|
|
|
|
class Class extends binding.BaseClass {
|
|
constructor() {
|
|
super();
|
|
this.method();
|
|
}
|
|
method() {
|
|
this.ok = true;
|
|
}
|
|
}
|
|
|
|
assert.ok(new Class() instanceof binding.BaseClass);
|
|
assert.ok(new Class().ok);
|
|
assert.ok(binding.OrdinaryFunction());
|
|
assert.ok(
|
|
new binding.Constructor(binding.Constructor) instanceof binding.Constructor);
|