Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(500)

Side by Side Diff: third_party/closure_compiler/runner/src/com/google/javascript/jscomp/ChromePass.java

Issue 1801293005: Fix cr.exportPath()'s @return signature so the result can be used (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: asdf Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ui/webui/resources/js/cr.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package com.google.javascript.jscomp; 5 package com.google.javascript.jscomp;
6 6
7 import com.google.javascript.jscomp.NodeTraversal.AbstractPostOrderCallback; 7 import com.google.javascript.jscomp.NodeTraversal.AbstractPostOrderCallback;
8 import com.google.javascript.rhino.IR; 8 import com.google.javascript.rhino.IR;
9 import com.google.javascript.rhino.JSDocInfoBuilder; 9 import com.google.javascript.rhino.JSDocInfoBuilder;
10 import com.google.javascript.rhino.JSTypeExpression; 10 import com.google.javascript.rhino.JSTypeExpression;
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 } 250 }
251 251
252 private void visitExportPath(Node crExportPathNode, Node parent) { 252 private void visitExportPath(Node crExportPathNode, Node parent) {
253 if (crExportPathNode.getChildCount() < 2) { 253 if (crExportPathNode.getChildCount() < 2) {
254 compiler.report(JSError.make(crExportPathNode, CR_EXPORT_PATH_TOO_FE W_ARGUMENTS)); 254 compiler.report(JSError.make(crExportPathNode, CR_EXPORT_PATH_TOO_FE W_ARGUMENTS));
255 return; 255 return;
256 } 256 }
257 257
258 Node pathArg = crExportPathNode.getChildAtIndex(1); 258 Node pathArg = crExportPathNode.getChildAtIndex(1);
259 if (pathArg.isString()) { 259 if (pathArg.isString()) {
260 // TODO(dbeam): support cr.exportPath('ns').value.
260 createAndInsertObjectsForQualifiedName(parent, pathArg.getString()); 261 createAndInsertObjectsForQualifiedName(parent, pathArg.getString());
261 } 262 }
262 } 263 }
263 264
264 private void createAndInsertObjectsForQualifiedName(Node scriptChild, String namespace) { 265 private void createAndInsertObjectsForQualifiedName(Node scriptChild, String namespace) {
265 List<Node> objectsForQualifiedName = createObjectsForQualifiedName(names pace); 266 List<Node> objectsForQualifiedName = createObjectsForQualifiedName(names pace);
266 for (Node n : objectsForQualifiedName) { 267 for (Node n : objectsForQualifiedName) {
267 scriptChild.getParent().addChildBefore(n, scriptChild); 268 scriptChild.getParent().addChildBefore(n, scriptChild);
268 } 269 }
269 } 270 }
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 } 447 }
447 } 448 }
448 449
449 private Node buildQualifiedName(Node internalName) { 450 private Node buildQualifiedName(Node internalName) {
450 String externalName = this.exports.get(internalName.getString()); 451 String externalName = this.exports.get(internalName.getString());
451 return NodeUtil.newQName(compiler, this.namespaceName + "." + extern alName).srcrefTree( 452 return NodeUtil.newQName(compiler, this.namespaceName + "." + extern alName).srcrefTree(
452 internalName); 453 internalName);
453 } 454 }
454 } 455 }
455 } 456 }
OLDNEW
« no previous file with comments | « no previous file | ui/webui/resources/js/cr.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698