@datadog/native-iast-rewriter
Advanced tools
Comparing version 2.2.3 to 2.3.0
@@ -90,5 +90,11 @@ const { getSourcePathAndLineFromSourceMaps } = require('../source-map') | ||
if (originalPrepareStackTrace) { | ||
const parsedCallSites = structuredStackTrace.map((callSite) => new WrappedCallSite(callSite)) | ||
let parsedCallSites | ||
try { | ||
parsedCallSites = structuredStackTrace.map((callSite) => new WrappedCallSite(callSite)) | ||
} catch (e) { | ||
parsedCallSites = structuredStackTrace | ||
} | ||
return originalPrepareStackTrace(error, parsedCallSites) | ||
} | ||
const stackLines = error.stack.split('\n') | ||
@@ -142,3 +148,4 @@ let firstIndex = -1 | ||
module.exports = { | ||
getPrepareStackTrace | ||
getPrepareStackTrace, | ||
kSymbolPrepareStackTrace | ||
} |
@@ -6,3 +6,3 @@ /** | ||
'use strict' | ||
const { getPrepareStackTrace } = require('./js/stack-trace/') | ||
const { getPrepareStackTrace, kSymbolPrepareStackTrace } = require('./js/stack-trace/') | ||
const { cacheRewrittenSourceMap, getOriginalPathAndLineFromSourceMap } = require('./js/source-map') | ||
@@ -84,3 +84,4 @@ | ||
getPrepareStackTrace, | ||
getOriginalPathAndLineFromSourceMap | ||
getOriginalPathAndLineFromSourceMap, | ||
kSymbolPrepareStackTrace | ||
} |
{ | ||
"name": "@datadog/native-iast-rewriter", | ||
"homepage": "https://github.com/DataDog/dd-native-iast-rewriter-js/blob/main/README.md", | ||
"version": "2.2.3", | ||
"version": "2.3.0", | ||
"description": "Datadog IAST instrumentation addon for NodeJS", | ||
@@ -6,0 +6,0 @@ "main": "main.js", |
let imports = {}; | ||
imports['__wbindgen_placeholder__'] = module.exports; | ||
let wasm; | ||
const { log, setLogger } = require(String.raw`./snippets/native-iast-rewriter-6a3bf7270b595175/tracer_logger.js`); | ||
const { log, setLogger } = require(String.raw`./snippets/native-iast-rewriter-2355e0e54b275e2c/tracer_logger.js`); | ||
const { readFileSync } = require(`fs`); | ||
const { dirname } = require(`path`); | ||
const { TextEncoder, TextDecoder } = require(`util`); | ||
const { TextDecoder, TextEncoder } = require(`util`); | ||
@@ -29,4 +29,6 @@ const heap = new Array(128).fill(undefined); | ||
let WASM_VECTOR_LEN = 0; | ||
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
cachedTextDecoder.decode(); | ||
let cachedUint8Memory0 = null; | ||
@@ -41,2 +43,18 @@ | ||
function getStringFromWasm0(ptr, len) { | ||
ptr = ptr >>> 0; | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
} | ||
function addHeapObject(obj) { | ||
if (heap_next === heap.length) heap.push(heap.length + 1); | ||
const idx = heap_next; | ||
heap_next = heap[idx]; | ||
heap[idx] = obj; | ||
return idx; | ||
} | ||
let WASM_VECTOR_LEN = 0; | ||
let cachedTextEncoder = new TextEncoder('utf-8'); | ||
@@ -108,20 +126,2 @@ | ||
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
cachedTextDecoder.decode(); | ||
function getStringFromWasm0(ptr, len) { | ||
ptr = ptr >>> 0; | ||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); | ||
} | ||
function addHeapObject(obj) { | ||
if (heap_next === heap.length) heap.push(heap.length + 1); | ||
const idx = heap_next; | ||
heap_next = heap[idx]; | ||
heap[idx] = obj; | ||
return idx; | ||
} | ||
let cachedFloat64Memory0 = null; | ||
@@ -315,2 +315,12 @@ | ||
module.exports.__wbindgen_is_string = function(arg0) { | ||
const ret = typeof(getObject(arg0)) === 'string'; | ||
return ret; | ||
}; | ||
module.exports.__wbindgen_error_new = function(arg0, arg1) { | ||
const ret = new Error(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbindgen_boolean_get = function(arg0) { | ||
@@ -347,7 +357,2 @@ const v = getObject(arg0); | ||
module.exports.__wbindgen_error_new = function(arg0, arg1) { | ||
const ret = new Error(getStringFromWasm0(arg0, arg1)); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbindgen_string_new = function(arg0, arg1) { | ||
@@ -358,3 +363,3 @@ const ret = getStringFromWasm0(arg0, arg1); | ||
module.exports.__wbg_log_d880dadb9e7bc467 = function() { return handleError(function (arg0, arg1) { | ||
module.exports.__wbg_log_b732d979dc629bf9 = function() { return handleError(function (arg0, arg1) { | ||
const ret = log(getObject(arg0), getObject(arg1)); | ||
@@ -364,3 +369,3 @@ return addHeapObject(ret); | ||
module.exports.__wbg_readFileSync_1fd06101be5c2bb6 = function() { return handleError(function (arg0, arg1) { | ||
module.exports.__wbg_readFileSync_ec1356933b166584 = function() { return handleError(function (arg0, arg1) { | ||
const ret = readFileSync(getStringFromWasm0(arg0, arg1)); | ||
@@ -370,3 +375,3 @@ return addHeapObject(ret); | ||
module.exports.__wbg_dirname_5e825c10ae41566f = function() { return handleError(function (arg0, arg1) { | ||
module.exports.__wbg_dirname_ee2f614163ee26b5 = function() { return handleError(function (arg0, arg1) { | ||
const ret = dirname(getStringFromWasm0(arg0, arg1)); | ||
@@ -376,3 +381,3 @@ return addHeapObject(ret); | ||
module.exports.__wbg_setLogger_d6ff5c4767b0a460 = function() { return handleError(function (arg0) { | ||
module.exports.__wbg_setLogger_e79faaa41aae0349 = function() { return handleError(function (arg0) { | ||
const ret = setLogger(getObject(arg0)); | ||
@@ -382,12 +387,2 @@ return addHeapObject(ret); | ||
module.exports.__wbindgen_is_string = function(arg0) { | ||
const ret = typeof(getObject(arg0)) === 'string'; | ||
return ret; | ||
}; | ||
module.exports.__wbindgen_object_clone_ref = function(arg0) { | ||
const ret = getObject(arg0); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) { | ||
@@ -405,10 +400,2 @@ const ret = getObject(arg0) == getObject(arg1); | ||
module.exports.__wbg_String_91fba7ded13ba54c = function(arg0, arg1) { | ||
const ret = String(getObject(arg1)); | ||
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len1 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len1; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr1; | ||
}; | ||
module.exports.__wbindgen_number_new = function(arg0) { | ||
@@ -424,2 +411,7 @@ const ret = arg0; | ||
module.exports.__wbindgen_object_clone_ref = function(arg0) { | ||
const ret = getObject(arg0); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbg_getwithrefkey_15c62c2b8546208d = function(arg0, arg1) { | ||
@@ -434,2 +426,10 @@ const ret = getObject(arg0)[getObject(arg1)]; | ||
module.exports.__wbg_String_91fba7ded13ba54c = function(arg0, arg1) { | ||
const ret = String(getObject(arg1)); | ||
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len1 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len1; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr1; | ||
}; | ||
module.exports.__wbg_new_abda76e883ba8a5f = function() { | ||
@@ -436,0 +436,0 @@ const ret = new Error(); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
1234
2147678