2017-04-10 23:09:15 -04:00
|
|
|
'use strict';
|
|
|
|
const common = require('../../common');
|
|
|
|
const assert = require('assert');
|
|
|
|
|
2019-03-07 01:03:53 +01:00
|
|
|
// Testing handle scope api calls
|
2018-01-23 21:49:25 +11:00
|
|
|
const testHandleScope =
|
|
|
|
require(`./build/${common.buildType}/test_handle_scope`);
|
2017-04-10 23:09:15 -04:00
|
|
|
|
|
|
|
testHandleScope.NewScope();
|
2017-04-19 14:58:58 -07:00
|
|
|
|
2017-04-10 23:09:15 -04:00
|
|
|
assert.ok(testHandleScope.NewScopeEscape() instanceof Object);
|
2017-04-19 14:58:58 -07:00
|
|
|
|
2017-10-14 13:02:02 +02:00
|
|
|
testHandleScope.NewScopeEscapeTwice();
|
2017-06-13 00:40:00 -04:00
|
|
|
|
2017-04-19 14:58:58 -07:00
|
|
|
assert.throws(
|
|
|
|
() => {
|
|
|
|
testHandleScope.NewScopeWithException(() => { throw new RangeError(); });
|
|
|
|
},
|
|
|
|
RangeError);
|