Page MenuHomec4science

checkConst.js
No OneTemporary

File Metadata

Created
Sat, Feb 1, 05:47

checkConst.js

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);
}
}

Event Timeline