diff --git a/src/babel/transformation/transformers/es6/constants.js b/src/babel/transformation/transformers/es6/constants.js index 1b4c552e46..def32a8321 100644 --- a/src/babel/transformation/transformers/es6/constants.js +++ b/src/babel/transformation/transformers/es6/constants.js @@ -1,13 +1,29 @@ import * as messages from "../../../messages"; /** - * [Please add a description.] + * Turn constants into variables. + * Ensure there are no constant violations in any scope. + * + * @example + * + * **In** + * + * ```javascript + * const MULTIPLIER = 5; + * ``` + * + * **Out** + * + * ```javascript + * var MULTIPLIER = 5; + * ``` */ export var visitor = { /** - * [Please add a description.] + * Look for any constants (or modules) in scope. + * If they have any `constantViolations` throw an error. */ Scope(node, parent, scope) { @@ -24,7 +40,8 @@ export var visitor = { }, /** - * [Please add a description.] + * Look for constants. + * Turn them into `let` variables. */ VariableDeclaration(node) {