diff --git a/packages/@glimmer/validator/lib/debug.ts b/packages/@glimmer/validator/lib/debug.ts index 98f8231f81..4bf111e1d6 100644 --- a/packages/@glimmer/validator/lib/debug.ts +++ b/packages/@glimmer/validator/lib/debug.ts @@ -3,7 +3,6 @@ import { DEBUG } from '@glimmer/env'; interface AutotrackingTransactionSourceData { context?: string; - error: Error; } export let runInAutotrackingTransaction: @@ -22,7 +21,7 @@ export let assertTagNotConsumed: | undefined | ((tag: Tag, obj?: T, keyName?: keyof T | string | symbol, forceHardError?: boolean) => void); -export let markTagAsConsumed: undefined | ((_tag: Tag, sourceError: Error) => void); +export let markTagAsConsumed: undefined | ((_tag: Tag) => void); if (DEBUG) { let DEPRECATE_IN_AUTOTRACKING_TRANSACTION = false; @@ -145,25 +144,16 @@ if (DEBUG) { message.push(`\`${String(keyName)}\` was first used:\n\n${sourceData.context}`); } - if (sourceData.error.stack) { - let sourceStack = sourceData.error.stack; - let thirdIndex = nthIndex(sourceStack, '\n', 3); - sourceStack = sourceStack.substr(thirdIndex); - - message.push(`Stack trace for the first usage: ${sourceStack}`); - } - message.push(`Stack trace for the update:`); return message.join('\n\n'); }; - markTagAsConsumed = (_tag: Tag, sourceError: Error) => { + markTagAsConsumed = (_tag: Tag) => { if (!AUTOTRACKING_TRANSACTION || AUTOTRACKING_TRANSACTION.has(_tag)) return; AUTOTRACKING_TRANSACTION.set(_tag, { context: debuggingContexts!.map(c => c.replace(/^/gm, ' ').replace(/^ /, '-')).join('\n\n'), - error: sourceError, }); // We need to mark the tag and all of its subtags as consumed, so we need to @@ -172,11 +162,11 @@ if (DEBUG) { let tag = _tag as any; if (tag.subtag) { - markTagAsConsumed!(tag.subtag, sourceError); + markTagAsConsumed!(tag.subtag); } if (tag.subtags) { - tag.subtags.forEach((tag: Tag) => markTagAsConsumed!(tag, sourceError)); + tag.subtags.forEach((tag: Tag) => markTagAsConsumed!(tag)); } }; diff --git a/packages/@glimmer/validator/lib/tracking.ts b/packages/@glimmer/validator/lib/tracking.ts index cdb941a0b4..8544eeb4bc 100644 --- a/packages/@glimmer/validator/lib/tracking.ts +++ b/packages/@glimmer/validator/lib/tracking.ts @@ -31,7 +31,7 @@ class Tracker { this.tags.add(tag); if (DEBUG) { - markTagAsConsumed!(tag, new Error()); + markTagAsConsumed!(tag); } this.last = tag;