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

Method checkConstantString

compiler_expr.go:860–869  ·  view source on GitHub ↗
(expr compiledExpr)

Source from the content-addressed store, hash-verified

858}
859
860func (c *compiler) checkConstantString(expr compiledExpr) (unistring.String, bool) {
861 if expr.constant() {
862 if val, ex := c.evalConst(expr); ex == nil {
863 if s, ok := val.(String); ok {
864 return s.string(), true
865 }
866 }
867 }
868 return "", false
869}
870
871func (c *compiler) compileBracketExpression(v *ast.BracketExpression) compiledExpr {
872 if sup, ok := v.Left.(*ast.SuperExpression); ok {

Callers 1

Calls 3

evalConstMethod · 0.95
constantMethod · 0.65
stringMethod · 0.65

Tested by

no test coverage detected