MCPcopy Create free account
hub / github.com/dop251/goja / compileIdentifierExpression

Method compileIdentifierExpression

compiler_expr.go:3163–3174  ·  view source on GitHub ↗
(v *ast.Identifier)

Source from the content-addressed store, hash-verified

3161}
3162
3163func (c *compiler) compileIdentifierExpression(v *ast.Identifier) compiledExpr {
3164 if c.scope.strict {
3165 c.checkIdentifierName(v.Name, int(v.Idx)-1)
3166 }
3167
3168 r := &compiledIdentifierExpr{
3169 name: v.Name,
3170 }
3171 r.offset = int(v.Idx) - 1
3172 r.init(c, v.Idx0())
3173 return r
3174}
3175
3176func (c *compiler) compileNumberLiteral(v *ast.NumberLiteral) compiledExpr {
3177 if c.scope.strict && len(v.Literal) > 1 && v.Literal[0] == '0' && v.Literal[1] <= '7' && v.Literal[1] >= '0' {

Callers 4

compileExpressionMethod · 0.95
emitObjectPatternMethod · 0.95
compileForIntoMethod · 0.95
emitGetterMethod · 0.80

Calls 3

checkIdentifierNameMethod · 0.95
initMethod · 0.65
Idx0Method · 0.65

Tested by

no test coverage detected