MCPcopy
hub / github.com/gopherjs/gopherjs / newIdent

Method newIdent

compiler/utils.go:331–335  ·  view source on GitHub ↗

newIdent declares a new Go variable with the given name and type and returns an *ast.Ident referring to that object.

(name string, t types.Type)

Source from the content-addressed store, hash-verified

329// newIdent declares a new Go variable with the given name and type and returns
330// an *ast.Ident referring to that object.
331func (fc *funcContext) newIdent(name string, t types.Type) *ast.Ident {
332 obj := types.NewVar(0, fc.pkgCtx.Pkg, name, t)
333 fc.objectNames[obj] = name
334 return fc.newIdentFor(obj)
335}
336
337// newIdentFor creates a new *ast.Ident referring to the given Go object.
338func (fc *funcContext) newIdentFor(obj types.Object) *ast.Ident {

Callers 9

translateStmtMethod · 0.95
translateResultsMethod · 0.95
expandTupleArgsMethod · 0.95
zeroValueMethod · 0.95
translateExprMethod · 0.95
delegatedCallMethod · 0.95
translateConversionMethod · 0.95
importInitializerMethod · 0.95
callMainFuncMethod · 0.95

Calls 1

newIdentForMethod · 0.95

Tested by

no test coverage detected