assign method
Assign value to a top level variable defined in a certain namespace in the interpreter.
Implementation
void assign(
String varName,
dynamic value, {
String? moduleName,
}) {
try {
final savedModuleName = _currentBytecodeModule.id;
HTNamespace nsp = getNamespace(moduleName: moduleName);
nsp.memberSet(varName, value, isRecursive: false);
if (_currentBytecodeModule.id != savedModuleName) {
_currentBytecodeModule = cachedModules[savedModuleName]!;
}
} catch (error, stackTrace) {
if (config.processError) {
processError(error, stackTrace);
} else {
rethrow;
}
}
}