Skip to content

Commit 1ace907

Browse files
authored
[DI] Use isString helper when asserting string (#5975)
When compiling conditions in Dynamic Instrumentation, use the `isString` helper method when asserting that something is a string.
1 parent 3367f5a commit 1ace907

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/dd-trace/src/debugger/devtools_client/condition.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ function guardAgainstCoercionSideEffects (variable) {
278278

279279
function assertString (variable) {
280280
return `((val) => {
281-
if (typeof val === 'string' || val instanceof String) {
281+
if (${isString('val')}) {
282282
return val
283283
} else {
284284
throw new TypeError('Variable is not a string')

0 commit comments

Comments
 (0)