2022-01-07 22:09:52 -05:00
|
|
|
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
|
2021-02-04 17:18:32 -05:00
|
|
|
"use strict";
|
2020-07-19 13:49:44 -04:00
|
|
|
|
|
|
|
((window) => {
|
2021-10-08 03:53:31 -04:00
|
|
|
const { TypeError, Symbol } = window.__bootstrap.primordials;
|
2020-09-19 17:30:59 -04:00
|
|
|
const illegalConstructorKey = Symbol("illegalConstructorKey");
|
|
|
|
|
2020-07-19 13:49:44 -04:00
|
|
|
function requiredArguments(
|
|
|
|
name,
|
|
|
|
length,
|
|
|
|
required,
|
|
|
|
) {
|
|
|
|
if (length < required) {
|
|
|
|
const errMsg = `${name} requires at least ${required} argument${
|
|
|
|
required === 1 ? "" : "s"
|
|
|
|
}, but only ${length} present`;
|
|
|
|
throw new TypeError(errMsg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
window.__bootstrap.webUtil = {
|
2020-09-19 17:30:59 -04:00
|
|
|
illegalConstructorKey,
|
2020-07-19 13:49:44 -04:00
|
|
|
requiredArguments,
|
|
|
|
};
|
|
|
|
})(this);
|