@datadog/wasm-js-rewriter
Version:
Datadog instrumentation addon for NodeJS
19 lines (15 loc) • 542 B
JavaScript
function generateCaller (method) {
return function (self, ...args) {
return method.apply(self, args)
}
}
const primordials = {
ArrayPrototypePush: generateCaller(Array.prototype.push),
ArrayPrototypeSlice: generateCaller(Array.prototype.slice),
ArrayPrototypeSort: generateCaller(Array.prototype.sort),
ArrayIsArray: Array.isArray,
ObjectPrototypeHasOwnProperty: generateCaller(Object.prototype.hasOwnProperty),
StringPrototypeCharAt: generateCaller(String.prototype.charAt)
}
module.exports = primordials