Skip to content

Commit

Permalink
fix(rum-core): fix for merge utility function (#1555)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-luna authored Jan 10, 2025
1 parent 274fca3 commit 0d1eda5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/rum-core/src/common/config-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class Config {
Math.round(transactionSampleRate * 10000) / 10000
}

merge(this.config, properties)
this.config = merge(this.config, properties)
this.events.send(CONFIG_CHANGE, [this.config])
}

Expand Down
8 changes: 4 additions & 4 deletions packages/rum-core/src/common/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,12 @@ function getCurrentScript() {
}
}

function extend(dst) {
return baseExtend(dst, slice.call(arguments, 1), false)
function extend() {
return baseExtend(Object.create(null), slice.call(arguments), false)
}

function merge(dst) {
return baseExtend(dst, slice.call(arguments, 1), true)
function merge() {
return baseExtend(Object.create(null), slice.call(arguments), true)
}

function isUndefined(obj) {
Expand Down
2 changes: 1 addition & 1 deletion packages/rum-core/src/performance-monitoring/span-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class SpanBase {
addContext(...context) {
if (context.length === 0) return
this.ensureContext()
merge(this.context, ...context)
this.context = merge(this.context, ...context)
}

end(endTime) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class Transaction extends SpanBase {
// is not setting explicitly the threshold and instead expecting to rely on the one by default.
this.options.reuseThreshold = options.reuseThreshold

extend(this.options, options)
this.options = extend(this.options, options)
}
}

Expand Down

0 comments on commit 0d1eda5

Please sign in to comment.