UNPKG
buble
Version:
latest (0.20.0)
0.20.0
0.19.8
0.19.7
0.19.6
0.19.5
0.19.4
0.19.3
0.19.2
0.19.1
0.19.0
0.18.0
0.17.3
0.17.2
0.17.1
0.17.0
0.16.0
0.15.2
0.15.1
0.15.0
0.14.3
0.14.2
0.14.1
0.14.0
0.13.2
0.13.1
0.13.0
0.12.5
0.12.4
0.12.3
0.12.2
0.12.1
0.12.0
0.11.6
0.11.5
0.11.4
0.11.3
0.11.2
0.11.1
0.11.0
0.10.7
0.10.6
0.10.5
0.10.4
0.10.3
0.10.2
0.10.1
0.10.0
0.9.3
0.9.2
0.9.1
0.9.0
0.8.5
0.8.4
0.8.3
0.8.2
0.8.1
0.8.0
0.7.1
0.7.0
0.6.7
0.6.6
0.6.5
0.6.4
0.6.3
0.6.2
0.6.1
0.6.0
0.5.8
0.5.7
0.5.6
0.5.5
0.5.4
0.5.3
0.5.2
0.5.1
0.5.0
0.4.24
0.4.23
0.4.22
0.4.21
0.4.20
0.4.18
0.4.17
0.4.16
0.4.15
0.4.14
0.4.13
0.4.12
0.4.11
0.4.10
0.4.9
0.4.8
0.4.7
0.4.6
0.4.5
0.4.4
0.4.3
0.4.2
0.4.1
0.4.0
0.3.4
0.3.3
0.3.2
0.3.1
0.3.0
0.2.2
0.2.1
0.2.0
0.1.0
The blazing fast, batteries-included ES2015 compiler
github.com/bublejs/buble
bublejs/buble
buble
/
src
/
utils
/
checkConst.js
9 lines
(7 loc)
•
294 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
import
CompileError
from
'./CompileError.js'
;
export
default
function
checkConst
(
identifier, scope
) {
const
declaration = scope.
findDeclaration
(identifier.
name
);
if
(declaration && declaration.
kind
===
'const'
) {
throw
new
CompileError
(
`
${identifier.name}
is read-only`
, identifier); } }