JS backend: report diagnostic when try to get referenece on builtin members instead of crash with Exception.

This commit is contained in:
Zalim Bashorov
2015-03-16 22:24:32 +03:00
parent 975c4ffab5
commit 8421a15521
7 changed files with 42 additions and 19 deletions
@@ -35,6 +35,7 @@ private val DIAGNOSTIC_FACTORY_TO_RENDERER by Delegates.lazy {
put(ErrorsJs.JSCODE_WARNING, "JavaScript: {0}", JsCallDataTextRenderer)
put(ErrorsJs.JSCODE_ARGUMENT_SHOULD_BE_CONSTANT, "Argument must be string constant")
put(ErrorsJs.NOT_SUPPORTED, "Cannot translate (not supported yet): ''{0}''", RenderFirstLineOfElementText)
put(ErrorsJs.REFERENCE_TO_BUILTIN_MEMBERS_NOT_SUPPORTED, "Callable references for builtin members are not supported yet: ''{0}''", RenderFirstLineOfElementText)
this
@@ -40,6 +40,7 @@ public interface ErrorsJs {
DiagnosticFactory1<JetExpression, JsCallData> JSCODE_WARNING = DiagnosticFactory1.create(WARNING, JsCodePositioningStrategy.INSTANCE$);
DiagnosticFactory0<JetExpression> JSCODE_ARGUMENT_SHOULD_BE_CONSTANT = DiagnosticFactory0.create(ERROR, DEFAULT);
DiagnosticFactory1<JetElement, JetElement> NOT_SUPPORTED = DiagnosticFactory1.create(ERROR, DEFAULT);
DiagnosticFactory1<JetElement, JetElement> REFERENCE_TO_BUILTIN_MEMBERS_NOT_SUPPORTED = DiagnosticFactory1.create(ERROR, DEFAULT);
@SuppressWarnings("UnusedDeclaration")
Object _initializer = new Object() {