widl-nan
Version:
Auto generate native C++ addon source code by parsing Web IDL definition
23 lines (18 loc) • 539 B
JavaScript
// Copyright (c) 2016 Intel Corporation. All rights reserved.
// Use of this source code is governed by a MIT-style license that can be
// found in the LICENSE file.
;
var assert = require('assert');
function testNoConstructor(templ) {
return assert.throws(function() {
// eslint-disable-next-line
var foo = new templ();
}, function(e) {
if (e instanceof TypeError && /constructor/.test(e)) {
return true;
}
}, 'Unexpected error');
}
module.exports = {
testNoConstructor: testNoConstructor
};