JS: renamed JsParser->JsAstMapper
This commit is contained in:
@@ -19,7 +19,7 @@ package org.jetbrains.kotlin.js.inline
|
||||
import com.google.dart.compiler.backend.js.ast.*
|
||||
import com.google.dart.compiler.backend.js.ast.metadata.inlineStrategy
|
||||
import com.google.dart.compiler.common.SourceInfoImpl
|
||||
import com.google.gwt.dev.js.JsParser
|
||||
import com.google.gwt.dev.js.JsAstMapper
|
||||
import com.google.gwt.dev.js.ThrowExceptionOnErrorReporter
|
||||
import com.google.gwt.dev.js.parserExceptions.AbortParsingException
|
||||
import com.google.gwt.dev.js.parserExceptions.JsParserException
|
||||
@@ -152,7 +152,7 @@ public class FunctionReader(private val context: TranslationContext) {
|
||||
val info = SourceInfoImpl(null, 0, 0, 0, 0)
|
||||
val scope = JsRootScope(context.program())
|
||||
val reader = StringReader(source)
|
||||
return JsParser.parse(info, scope, reader, ThrowExceptionOnErrorReporter, /* insideFunction= */ false)
|
||||
return JsAstMapper.parse(info, scope, reader, ThrowExceptionOnErrorReporter, /* insideFunction= */ false)
|
||||
}
|
||||
catch (e: Exception) {
|
||||
throw RuntimeException(e)
|
||||
|
||||
+3
-3
@@ -34,7 +34,7 @@ import static com.google.dart.compiler.util.AstUtil.toFunctionScope;
|
||||
/**
|
||||
* Parses JavaScript source.
|
||||
*/
|
||||
public class JsParser {
|
||||
public class JsAstMapper {
|
||||
|
||||
private final JsProgram program;
|
||||
private final ScopeContext scopeContext;
|
||||
@@ -45,7 +45,7 @@ public class JsParser {
|
||||
ErrorReporter errorReporter,
|
||||
boolean insideFunction
|
||||
) throws IOException, JsParserException {
|
||||
return new JsParser(scope).parseImpl(rootSourceInfo, r, errorReporter, insideFunction);
|
||||
return new JsAstMapper(scope).parseImpl(rootSourceInfo, r, errorReporter, insideFunction);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -53,7 +53,7 @@ public class JsParser {
|
||||
*/
|
||||
private static final String SOURCE_NAME_STUB = "jsCode";
|
||||
|
||||
private JsParser(@NotNull JsScope scope) {
|
||||
private JsAstMapper(@NotNull JsScope scope) {
|
||||
scopeContext = new ScopeContext(scope);
|
||||
program = scope.getProgram();
|
||||
}
|
||||
+2
-2
@@ -18,7 +18,7 @@ package org.jetbrains.kotlin.js.translate.reference;
|
||||
|
||||
import com.google.dart.compiler.backend.js.ast.*;
|
||||
import com.google.dart.compiler.common.SourceInfoImpl;
|
||||
import com.google.gwt.dev.js.JsParser;
|
||||
import com.google.gwt.dev.js.JsAstMapper;
|
||||
import com.google.gwt.dev.js.ThrowExceptionOnErrorReporter;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -144,7 +144,7 @@ public final class CallExpressionTranslator extends AbstractCallExpressionTransl
|
||||
SourceInfoImpl info = new SourceInfoImpl(null, 0, 0, 0, 0);
|
||||
JsScope scope = context().scope();
|
||||
StringReader reader = new StringReader(jsCode);
|
||||
statements.addAll(JsParser.parse(info, scope, reader, ThrowExceptionOnErrorReporter.INSTANCE$, /* insideFunction= */ true));
|
||||
statements.addAll(JsAstMapper.parse(info, scope, reader, ThrowExceptionOnErrorReporter.INSTANCE$, /* insideFunction= */ true));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user