* Sets a synchronous value resolver for the variable with the specified name. * The value resolver may optionally take an extra parameter. * Can be called in conjunction with setAsync to allow for additional * asynchronous resolver where expand will use async and expandSync the sync * ve
(varName, syncResolver)
| 214 | * @return {!VariableSource} |
| 215 | */ |
| 216 | set(varName, syncResolver) { |
| 217 | devAssert(varName.indexOf('RETURN') == -1); |
| 218 | this.replacements_[varName] = this.replacements_[varName] || { |
| 219 | sync: undefined, |
| 220 | async: undefined, |
| 221 | }; |
| 222 | this.replacements_[varName].sync = syncResolver; |
| 223 | return this; |
| 224 | } |
| 225 | |
| 226 | /** |
| 227 | * Sets an async value resolver for the variable with the specified name. |