Skip to content

Commit

Permalink
fix: missing parameter options in _shimPropertySilent() (#10)
Browse files Browse the repository at this point in the history
Otherwise this function depends on a global, which may lead to
unexpected results.
  • Loading branch information
jrummell-chromium authored Jun 23, 2022
1 parent 2c29e42 commit b7fa653
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions trace-anything.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ class TraceAnything {
if (options.methods) {
TraceAnything._shimMethod(traced, object, k, className, options);
} else {
TraceAnything._shimPropertySilent(traced, object, k);
TraceAnything._shimPropertySilent(traced, object, k, options);
}
} else if (options.properties && options.treatPromisePropertiesAsEvents &&
object[k] && object[k].then) {
Expand All @@ -320,7 +320,7 @@ class TraceAnything {
if (options.properties) {
TraceAnything._shimProperty(traced, object, k, className, options);
} else {
TraceAnything._shimPropertySilent(traced, object, k);
TraceAnything._shimPropertySilent(traced, object, k, options);
}
}
}
Expand Down Expand Up @@ -618,9 +618,10 @@ class TraceAnything {
* @param {!Object} traced The traced object.
* @param {!Object} object The original object.
* @param {string} k The member name.
* @param {TraceAnything.Options} options
* @private
*/
static _shimPropertySilent(traced, object, k) {
static _shimPropertySilent(traced, object, k, options) {
if (options.inPlace) {
// If we're shimming the object in-place, we don't need a "silent" shim.
// That is only needed for constructing a new traced object to take the
Expand Down

0 comments on commit b7fa653

Please sign in to comment.