UNPKG

lml-main

Version:

This is now a mono repository published into many standalone packages.

6 lines (5 loc) 268 B
var assert = require('./assert'); var getTypeName = require('./getTypeName'); module.exports = function forbidNewOperator(x, type) { assert(!(x instanceof type), function () { return 'Cannot use the new operator to instantiate the type ' + getTypeName(type); }); };