Skip to content

Commit 0d1eda5

Browse files
authored
fix(rum-core): fix for merge utility function (#1555)
1 parent 274fca3 commit 0d1eda5

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/rum-core/src/common/config-service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ class Config {
190190
Math.round(transactionSampleRate * 10000) / 10000
191191
}
192192

193-
merge(this.config, properties)
193+
this.config = merge(this.config, properties)
194194
this.events.send(CONFIG_CHANGE, [this.config])
195195
}
196196

packages/rum-core/src/common/utils.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,12 +284,12 @@ function getCurrentScript() {
284284
}
285285
}
286286

287-
function extend(dst) {
288-
return baseExtend(dst, slice.call(arguments, 1), false)
287+
function extend() {
288+
return baseExtend(Object.create(null), slice.call(arguments), false)
289289
}
290290

291-
function merge(dst) {
292-
return baseExtend(dst, slice.call(arguments, 1), true)
291+
function merge() {
292+
return baseExtend(Object.create(null), slice.call(arguments), true)
293293
}
294294

295295
function isUndefined(obj) {

packages/rum-core/src/performance-monitoring/span-base.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class SpanBase {
7777
addContext(...context) {
7878
if (context.length === 0) return
7979
this.ensureContext()
80-
merge(this.context, ...context)
80+
this.context = merge(this.context, ...context)
8181
}
8282

8383
end(endTime) {

packages/rum-core/src/performance-monitoring/transaction.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class Transaction extends SpanBase {
8888
// is not setting explicitly the threshold and instead expecting to rely on the one by default.
8989
this.options.reuseThreshold = options.reuseThreshold
9090

91-
extend(this.options, options)
91+
this.options = extend(this.options, options)
9292
}
9393
}
9494

0 commit comments

Comments
 (0)