From 3207a387a73611f81ae1b68c63b7467890e01427 Mon Sep 17 00:00:00 2001 From: James Kyle Date: Sat, 11 Jul 2015 12:08:03 -0700 Subject: [PATCH] Add descriptions to transformation/transformers/es6/constants --- .../transformers/es6/constants.js | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) 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) {