Package com.google.gwt.thirdparty.debugging.sourcemap

Examples of com.google.gwt.thirdparty.debugging.sourcemap.SourceMapConsumerV3


  /**
   * Reads a source map from disk and parses it into an in-memory representation.
   * If it can't be loaded, logs a warning and returns an empty source map.
   */
  static ReverseSourceMap load(TreeLogger logger, File sourceMapFile) {
    SourceMapConsumerV3 consumer = new SourceMapConsumerV3();
    String unparsed = Util.readFileAsString(sourceMapFile);
    try {
      consumer.parse(unparsed);
      return new ReverseSourceMap(consumer);
    } catch (SourceMapParseException e) {
      logger.log(TreeLogger.WARN, "can't parse source map", e);
      return new ReverseSourceMap(null);
    }
View Full Code Here


        new FilePosition(99, 0), new FilePosition(99, 1));

    StringBuilder generated = new StringBuilder();
    generator.appendTo(generated, "test");

    SourceMapConsumerV3 consumer = new SourceMapConsumerV3();
    consumer.parse(generated.toString());

    final StringBuilder out = new StringBuilder();
    out.append("Mappings:\n");

    consumer.visitMappings(new EntryVisitor() {
      @Override
      public void visit(String javaFile, String javaName, FilePosition javaStart,
          FilePosition jsStart, FilePosition jsEnd) {

        if (javaFile.equals("Dummy")) {
View Full Code Here

  private void checkSourceMap(File symbolMap, List<File> sourceMapFiles)
      throws Exception {
    final Map<String, SimpleSymbolData> symbolTable = SimpleSymbolData.readSymbolMap(symbolMap);
    boolean firstIteration = true;
    for (File sourceMapFile : sourceMapFiles) {
      SourceMapConsumerV3 sourceMap = new SourceMapConsumerV3();
      sourceMap.parse(stringContent(sourceMapFile));
      if (firstIteration) {
        Integer permutationId = (Integer) sourceMap.getExtensions().get("x_gwt_permutation");
        assertNotNull(permutationId);
        mapping.put(permutationId, symbolTable);
        firstIteration = false;
      }
      sourceMap.visitMappings(new  SourceMapConsumerV3.EntryVisitor() {
        @Override
        public void visit(String sourceName, String symbolName,
            FilePosition srcStartPos, FilePosition startPosition,FilePosition endPosition) {
          if (symbolName == null || symbolName.isEmpty()) {
            return;
View Full Code Here

    consumer.parse(generated.toString());

    final StringBuilder out = new StringBuilder();
    out.append("Mappings:\n");

    consumer.visitMappings(new EntryVisitor() {
      @Override
      public void visit(String javaFile, String javaName, FilePosition javaStart,
          FilePosition jsStart, FilePosition jsEnd) {

        if (javaFile.equals("Dummy")) {
View Full Code Here

TOP

Related Classes of com.google.gwt.thirdparty.debugging.sourcemap.SourceMapConsumerV3

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.