Examples of LibraryResolver


Examples of com.google.dart.engine.internal.resolver.LibraryResolver

   * @return an entry containing the computed results
   * @throws AnalysisException if the results could not be recorded
   */
  protected DartEntry recordResolveDartLibraryTaskResults(ResolveDartLibraryTask task)
      throws AnalysisException {
    LibraryResolver resolver = task.getLibraryResolver();
    AnalysisException thrownException = task.getException();
    DartEntry unitEntry = null;
    Source unitSource = task.getUnitSource();
    if (resolver != null) {
      //
      // The resolver should only be null if an exception was thrown before (or while) it was
      // being created.
      //
      Set<Library> resolvedLibraries = resolver.getResolvedLibraries();
      synchronized (cacheLock) {
        if (resolvedLibraries == null) {
          //
          // The resolved libraries should only be null if an exception was thrown during resolution.
          //
          unitEntry = getReadableDartEntry(unitSource);
          if (unitEntry == null) {
            throw new AnalysisException("A Dart file became a non-Dart file: "
                + unitSource.getFullName());
          }
          DartEntryImpl dartCopy = unitEntry.getWritableCopy();
          if (thrownException == null) {
            dartCopy.recordResolutionError(new AnalysisException(
                "In recordResolveDartLibraryTaskResults, resolvedLibraries was null and there was no thrown exception"));
          } else {
            dartCopy.recordResolutionError(thrownException);
          }
          cache.put(unitSource, dartCopy);
          cache.remove(unitSource);
          if (thrownException != null) {
            throw thrownException;
          }
          return dartCopy;
        }
        if (allModificationTimesMatch(resolvedLibraries)) {
          Source htmlSource = getSourceFactory().forUri(DartSdk.DART_HTML);
          RecordingErrorListener errorListener = resolver.getErrorListener();
          for (Library library : resolvedLibraries) {
            Source librarySource = library.getLibrarySource();
            for (Source source : library.getCompilationUnitSources()) {
              CompilationUnit unit = library.getAST(source);
              AnalysisError[] errors = errorListener.getErrorsForSource(source);
View Full Code Here

Examples of com.google.dart.engine.internal.resolver.LibraryResolver

      XmlAttributeNode scriptAttribute = getScriptSourcePath(node);
      String scriptSourcePath = scriptAttribute == null ? null : scriptAttribute.getText();
      if (node.getAttributeEnd().getType() == TokenType.GT && scriptSourcePath == null) {
        EmbeddedHtmlScriptElementImpl script = new EmbeddedHtmlScriptElementImpl(node);
        try {
          LibraryResolver resolver = new LibraryResolver(context);
          LibraryElementImpl library = (LibraryElementImpl) resolver.resolveEmbeddedLibrary(
              htmlSource,
              modificationStamp,
              node.getScript(),
              true);
          script.setScriptLibrary(library);
          resolvedLibraries.addAll(resolver.getResolvedLibraries());
          errorListener.addAll(resolver.getErrorListener());
        } catch (AnalysisException exception) {
          //TODO (danrubel): Handle or forward the exception
          AnalysisEngine.getInstance().getLogger().logError(
              "Could not resolve script tag",
              exception);
View Full Code Here

Examples of com.google.dart.engine.internal.resolver.LibraryResolver

    return "resolve library " + librarySource.getFullName();
  }

  @Override
  protected void internalPerform() throws AnalysisException {
    resolver = new LibraryResolver(getContext());
    resolver.resolveLibrary(librarySource, true);
  }
View Full Code Here

Examples of org.moyrax.resolver.LibraryResolver

    engine = new ConfigurableEngine(this.runner.getClient());

    engine.registerClass(Global.class);
    engine.registerClass(Shell.class);

    Shell.setResolver("lib", new LibraryResolver("/org/moyrax/javascript/lib"));
    Shell.setResolver("classpath", resourceResolver);

    runner.getClient().setJavaScriptEngine(engine);
  }
View Full Code Here

Examples of org.moyrax.resolver.LibraryResolver

    context = HtmlUnitContextFactory.getGlobal().enterContext();
    context.setOptimizationLevel(-1);
    scope = (ScriptableObject)context.initStandardObjects(shell);

    Shell.setResolver("lib", new LibraryResolver("/org/moyrax/javascript/lib"));
    // We only have the current project, so we initialize the ClassPathResolver
    // with the context class loader.
    Shell.setResolver("classpath", new ClassPathResolver(
        Thread.currentThread().getContextClassLoader()));
View Full Code Here

Examples of org.moyrax.resolver.LibraryResolver

public class LibraryResolverTest {
  private LibraryResolver resolver;

  @Before
  public void setUp() {
    resolver = new LibraryResolver("/org/moyrax/javascript/");
  }
View Full Code Here

Examples of org.moyrax.resolver.LibraryResolver

    });

    context.setClassLoader(new ContextClassLoader(
        Thread.currentThread().getContextClassLoader()));

    Shell.setResolver("lib", new LibraryResolver("/org/moyrax/javascript/lib"));
    Shell.setResolver("classpath", new ClassPathResolver(
        Thread.currentThread().getContextClassLoader()));

    loadContextResources(testingClient);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.