validate identifier names

This commit is contained in:
Stepan Koltsov
2012-04-09 21:25:01 +04:00
parent d889ca37b8
commit ea1592e8a3
2 changed files with 38 additions and 0 deletions
@@ -19,6 +19,7 @@ package org.jetbrains.k2js.translate.context;
import com.google.dart.compiler.backend.js.ast.JsName;
import com.google.dart.compiler.backend.js.ast.JsScope;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.resolve.NameUtils;
import org.jetbrains.k2js.translate.utils.JsAstUtils;
/**
@@ -54,6 +55,7 @@ public final class NamingScope {
@NotNull
/*package*/ JsName declareUnobfuscatableName(@NotNull String name) {
NameUtils.requireIdentifier(name);
JsName declaredName = scope.declareName(name);
declaredName.setObfuscatable(false);
return declaredName;