[Pkg-javascript-commits] [uglifyjs] 93/190: Update README for /** @const */
Antonio Terceiro
terceiro at moszumanska.debian.org
Sun Aug 7 23:17:16 UTC 2016
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to annotated tag upstream/2.7.0
in repository uglifyjs.
commit 918c17bd88647899be7fa1d9adabfe635cd6102d
Author: Samuel Reed <samuel.trace.reed at gmail.com>
Date: Tue Jan 19 13:24:36 2016 -0600
Update README for /** @const */
---
README.md | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 67324db..6dea439 100644
--- a/README.md
+++ b/README.md
@@ -395,6 +395,8 @@ separate file and include it into the build. For example you can have a
```javascript
const DEBUG = false;
const PRODUCTION = true;
+// Alternative for environments that don't support `const`
+/** @const */ var STAGING = false;
// etc.
```
@@ -404,8 +406,8 @@ and build your code like this:
UglifyJS will notice the constants and, since they cannot be altered, it
will evaluate references to them to the value itself and drop unreachable
-code as usual. The possible downside of this approach is that the build
-will contain the `const` declarations.
+code as usual. The build will contain the `const` declarations if you use
+them. If you are targeting < ES6 environments, use `/** @const */ var`.
<a name="codegen-options"></a>
## Beautifier options
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/uglifyjs.git
More information about the Pkg-javascript-commits
mailing list