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

Method processKey

compiler_expr.go:1779–1790  ·  view source on GitHub ↗
(expr ast.Expression)

Source from the content-addressed store, hash-verified

1777}
1778
1779func (c *compiler) processKey(expr ast.Expression) (val unistring.String, computed bool) {
1780 keyExpr := c.compileExpression(expr)
1781 if keyExpr.constant() {
1782 v, ex := c.evalConst(keyExpr)
1783 if ex == nil {
1784 return v.string(), false
1785 }
1786 }
1787 keyExpr.emitGetter(true)
1788 computed = true
1789 return
1790}
1791
1792func (e *compiledClassLiteral) processClassKey(expr ast.Expression) (privateName *privateName, key unistring.String, computed bool) {
1793 if p, ok := expr.(*ast.PrivateIdentifier); ok {

Callers 2

processClassKeyMethod · 0.80
emitGetterMethod · 0.80

Calls 5

compileExpressionMethod · 0.95
evalConstMethod · 0.95
constantMethod · 0.65
stringMethod · 0.65
emitGetterMethod · 0.65

Tested by

no test coverage detected