public static JSDocInfoBuilder maybeCopyFrom(@Nullable JSDocInfo info) { if (info == null) { return new JSDocInfoBuilder(true); } return copyFrom(info); }
public static JSDocInfoBuilder maybeCopyFrom(@Nullable JSDocInfo info) { if (info == null) { return new JSDocInfoBuilder(true); } return copyFrom(info); }
private void setFileOverviewJsDoc(Node irNode) { // Only after we've seen all @fileoverview entries, attach the // last one to the root node, and copy the found license strings // to that node. JSDocInfo rootNodeJsDoc = fileLevelJsDocBuilder.build(); if (rootNodeJsDoc != null) { irNode.setJSDocInfo(rootNodeJsDoc); } if (fileOverviewInfo != null) { if ((irNode.getJSDocInfo() != null) && (irNode.getJSDocInfo().getLicense() != null)) { JSDocInfoBuilder builder = JSDocInfoBuilder.copyFrom(fileOverviewInfo); builder.recordLicense(irNode.getJSDocInfo().getLicense()); fileOverviewInfo = builder.build(); } irNode.setJSDocInfo(fileOverviewInfo); } }
private void setFileOverviewJsDoc(Node irNode) { // Only after we've seen all @fileoverview entries, attach the // last one to the root node, and copy the found license strings // to that node. JSDocInfo rootNodeJsDoc = fileLevelJsDocBuilder.build(); if (rootNodeJsDoc != null) { irNode.setJSDocInfo(rootNodeJsDoc); } if (fileOverviewInfo != null) { if ((irNode.getJSDocInfo() != null) && (irNode.getJSDocInfo().getLicense() != null)) { JSDocInfoBuilder builder = JSDocInfoBuilder.copyFrom(fileOverviewInfo); builder.recordLicense(irNode.getJSDocInfo().getLicense()); fileOverviewInfo = builder.build(); } irNode.setJSDocInfo(fileOverviewInfo); } }
: JSDocInfoBuilder.copyFrom(script.getJSDocInfo()); if (!jsDocInfo.isPopulatedWithFileOverview()) { jsDocInfo.recordFileOverview("");
private void maybeUpdateExportDeclToNode(NodeTraversal t, Node target, Node value) { if (!currentScript.isModule) { return; } // If the RHS is a typedef, clone the declaration. // Hack alert: clone the typedef declaration if one exists // this is a simple attempt that covers the common case of the // exports being in the same scope as the typedef declaration. // Otherwise the type name might be invalid. if (value.isName()) { Scope currentScope = t.getScope(); Var v = t.getScope().getVar(value.getString()); if (v != null) { AbstractScope<?, ?> varScope = v.getScope(); if (varScope.getDepth() == currentScope.getDepth()) { JSDocInfo info = v.getJSDocInfo(); if (info != null && info.hasTypedefType()) { JSDocInfoBuilder builder = JSDocInfoBuilder.copyFrom(info); target.setJSDocInfo(builder.build()); return; } } } } markConstAndCopyJsDoc(target, target); }
private void maybeUpdateExportDeclToNode(NodeTraversal t, Node target, Node value) { if (!currentScript.isModule) { return; } // If the RHS is a typedef, clone the declaration. // Hack alert: clone the typedef declaration if one exists // this is a simple attempt that covers the common case of the // exports being in the same scope as the typedef declaration. // Otherwise the type name might be invalid. if (value.isName()) { Scope currentScope = t.getScope(); Var v = t.getScope().getVar(value.getString()); if (v != null) { Scope varScope = v.getScope(); if (varScope.getDepth() == currentScope.getDepth()) { JSDocInfo info = v.getJSDocInfo(); if (info != null && info.hasTypedefType()) { JSDocInfoBuilder builder = JSDocInfoBuilder.copyFrom(info); target.setJSDocInfo(builder.build()); return; } } } } markConstAndCopyJsDoc(target, target, value); }
JSTypeExpression elementBaseType = new JSTypeExpression(new Node(Token.BANG, IR.string(elementType)), VIRTUAL_FILE); JSDocInfoBuilder baseDocs = JSDocInfoBuilder.copyFrom(baseExterns.getJSDocInfo()); baseDocs.changeBaseType(elementBaseType); baseExterns.setJSDocInfo(baseDocs.build());
? JSDocInfoBuilder.copyFrom(ctorInfo) : new JSDocInfoBuilder(true);
JSDocInfoBuilder baseDocs = JSDocInfoBuilder.copyFrom(baseExterns.getJSDocInfo()); baseDocs.changeBaseType(elementBaseType); baseExterns.setJSDocInfo(baseDocs.build());
? JSDocInfoBuilder.copyFrom(ctorInfo) : new JSDocInfoBuilder(true);
newNode = IR.assign(getprop, IR.name(name)); builder = JSDocInfoBuilder.copyFrom(oldJSDocInfo);
builder = JSDocInfoBuilder.copyFrom(oldJSDocInfo);