NoOpModuleContext class

A no-op module context for executing pre-parsed AST without import support.

Use this when:

  • Executing single-file scripts without imports
  • All imports are already resolved and inlined in the AST
  • Testing interpreter functionality without module loading

Any attempt to load a module will throw an exception. All permission checks return true (permissive mode).

Implemented types

Constructors

NoOpModuleContext({Environment? globalEnvironment, PermissionChecker? permissionChecker})

Properties

currentLibrary ↔ Uri?
The current library URI being executed.
getter/setter pairoverride
globalEnvironment → Environment
The global environment shared across all modules.
no setteroverride
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

checkPermission(dynamic operation) → bool
Checks if a permission is granted for the given operation.
override
loadModule(Uri uri, {Set<String>? showNames, Set<String>? hideNames}) → LoadedModule
Loads a module from the given URI.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited