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

Method constant

compiler_expr.go:2570–2583  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2568}
2569
2570func (e *compiledLogicalOr) constant() bool {
2571 if e.left.constant() {
2572 if v, ex := e.c.evalConst(e.left); ex == nil {
2573 if v.ToBoolean() {
2574 return true
2575 }
2576 return e.right.constant()
2577 } else {
2578 return true
2579 }
2580 }
2581
2582 return false
2583}
2584
2585func (e *compiledLogicalOr) emitGetter(putOnStack bool) {
2586 if e.left.constant() {

Callers

nothing calls this directly

Calls 3

evalConstMethod · 0.80
constantMethod · 0.65
ToBooleanMethod · 0.65

Tested by

no test coverage detected