summaryrefslogtreecommitdiff
path: root/test/addons-napi/test_handle_scope/test.js
blob: 20bee78882f07144335390d6d4dd73bad9c5e3db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
'use strict';
const common = require('../../common');
const assert = require('assert');

// testing handle scope api calls
const testHandleScope =
    require(`./build/${common.buildType}/test_handle_scope`);

testHandleScope.NewScope();

assert.ok(testHandleScope.NewScopeEscape() instanceof Object);

assert.throws(
  () => {
    testHandleScope.NewScopeWithException(() => { throw new RangeError(); });
  },
  RangeError);