ericmckean / traceur-compiler

Automatically exported from code.google.com/p/traceur-compiler
Apache License 2.0
0 stars 0 forks source link

Project.getSourceTrees() inconsistent API #176

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm trying to figure out why I stumble over the project level API.

One candidate: one of these is not like the others:
    /**
   * @return {Array.<Program>}
   */
  getSourceTrees() {
    return this.parseTrees_.values();
  }

  /**
   * @param {SourceFile} file
   * @param {Program} tree
   * @return {void}
   */
  setParseTree(file, tree) {
    if (this.sourceFiles_[file.name] != file) {
      throw new Error();
    }
    this.parseTrees_.set(file, tree);
  }

  /**
   * @param {SourceFile} file
   * @return {Program}
   */
  getParseTree(file) {
    return this.parseTrees_.get(file);
  }

Thus: I suggest we change Project.getSourceTrees() -> Project.getParseTrees()

Original issue reported on code.google.com by johnjbar...@chromium.org on 29 Nov 2012 at 4:51

GoogleCodeExporter commented 9 years ago
Sounds good to me

Original comment by arv@chromium.org on 29 Nov 2012 at 6:23

GoogleCodeExporter commented 9 years ago
landed
https://codereview.appspot.com/6850131

The bigger issue is: internally the API is based on objectMap-s but the Project 
API encapsulates its objectMap then WebBasedProject hapzardly exposes it. 

Original comment by johnjbar...@chromium.org on 1 Dec 2012 at 4:20

GoogleCodeExporter commented 9 years ago

Original comment by johnjbar...@chromium.org on 1 Dec 2012 at 4:22