diff --git a/packages/babel-plugin-minify-mangle-names/src/index.js b/packages/babel-plugin-minify-mangle-names/src/index.js index 66da547d8..9c38028c3 100644 --- a/packages/babel-plugin-minify-mangle-names/src/index.js +++ b/packages/babel-plugin-minify-mangle-names/src/index.js @@ -153,10 +153,9 @@ module.exports = babel => { // This should NOT happen ultimately. Panic if this code block is // reached throw new Error( - "Binding not found for ReferencedIdentifier. " + - name + - "Please report this at " + - newIssueUrl + `Binding not found for ReferencedIdentifier "${name}" ` + + `present in "${path.parentPath.type}". ` + + `Please report this at ${newIssueUrl}` ); } else { // Add it to our scope tracker if everything is fine @@ -188,10 +187,9 @@ module.exports = babel => { // This should NOT happen ultimately. Panic if this code is reached throw new Error( - "Binding not found for BindingIdentifier. " + - name + - "Please report this at " + - newIssueUrl + `Binding not found for BindingIdentifier "${name}" ` + + `present in "${path.parentPath.type}". ` + + `Please report this at ${newIssueUrl}` ); } @@ -480,7 +478,7 @@ module.exports = babel => { } else { throw new Error( `Unexpected Rename Error: ` + - `Trying to replace ${node.name}: from ${oldName} to ${newName}` + + `Trying to replace "${node.name}": from "${oldName}" to "${newName}". ` + `Please report it at ${newIssueUrl}` ); } diff --git a/packages/babel-plugin-minify-mangle-names/src/scope-tracker.js b/packages/babel-plugin-minify-mangle-names/src/scope-tracker.js index 1e0c8becb..c6300d7f2 100644 --- a/packages/babel-plugin-minify-mangle-names/src/scope-tracker.js +++ b/packages/babel-plugin-minify-mangle-names/src/scope-tracker.js @@ -42,7 +42,7 @@ module.exports = class ScopeTracker { this.references.get(parent).add(name); if (!binding) { throw new Error( - `Binding Not Found for ${name} during scopeTracker.addRefernce: ` + + `Binding Not Found for ${name} during scopeTracker.addRefernce. ` + `Please report at ${newIssueUrl}` ); } @@ -83,8 +83,8 @@ module.exports = class ScopeTracker { if (!binding) { // Something went wrong - panic throw new Error( - "Binding Not Found during scopeTracker.updateRefernce: " + - `Updating "${oldName}" to "${newName}"` + + "Binding Not Found during scopeTracker.updateRefernce " + + `while updating "${oldName}" to "${newName}". ` + `Please report at ${newIssueUrl}` ); } @@ -167,11 +167,9 @@ module.exports = class ScopeTracker { if (existingBinding && existingBinding !== binding) { throw new Error( - "Binding " + - existingBinding.identifier.name + - "already exists. " + - "Trying to add " + - binding.identifier.name + `scopeTracker.addBinding: ` + + `Binding "${existingBinding.identifier.name}" already exists. ` + + `Trying to add "${binding.identifier.name}" again.` ); }