Search in sources :

Example 6 with SourceTextModuleRecord

use of com.github.anba.es6draft.runtime.modules.SourceTextModuleRecord in project es6draft by anba.

the class TestFileModuleLoader method defineFromTemplate.

@Override
public void defineFromTemplate(ModuleRecord template, Realm realm) {
    if (!(template instanceof SourceTextModuleRecord)) {
        throw new IllegalArgumentException();
    }
    SourceTextModuleRecord module = ((SourceTextModuleRecord) template).clone();
    defineModule(module);
    linkModule(module, realm);
}
Also used : SourceTextModuleRecord(com.github.anba.es6draft.runtime.modules.SourceTextModuleRecord)

Aggregations

SourceTextModuleRecord (com.github.anba.es6draft.runtime.modules.SourceTextModuleRecord)6 Name (com.github.anba.es6draft.ast.scope.Name)2 ModuleExport (com.github.anba.es6draft.runtime.modules.ModuleExport)2 FunctionObject (com.github.anba.es6draft.runtime.types.builtins.FunctionObject)2 Executable (com.github.anba.es6draft.Executable)1 Script (com.github.anba.es6draft.Script)1 Declaration (com.github.anba.es6draft.ast.Declaration)1 HoistableDeclaration (com.github.anba.es6draft.ast.HoistableDeclaration)1 StatementListItem (com.github.anba.es6draft.ast.StatementListItem)1 VariableStatement (com.github.anba.es6draft.ast.VariableStatement)1 ModuleScope (com.github.anba.es6draft.ast.scope.ModuleScope)1 ModuleName (com.github.anba.es6draft.compiler.CodeGenerator.ModuleName)1 MethodName (com.github.anba.es6draft.compiler.assembler.MethodName)1 SharedFunctions.loadScript (com.github.anba.es6draft.repl.global.SharedFunctions.loadScript)1 SharedFunctions.relativePathToScript (com.github.anba.es6draft.repl.global.SharedFunctions.relativePathToScript)1 ToFlatString (com.github.anba.es6draft.runtime.AbstractOperations.ToFlatString)1 ExecutionContext (com.github.anba.es6draft.runtime.ExecutionContext)1 LexicalEnvironment (com.github.anba.es6draft.runtime.LexicalEnvironment)1 ModuleEnvironmentRecord (com.github.anba.es6draft.runtime.ModuleEnvironmentRecord)1 DebugInfo (com.github.anba.es6draft.runtime.internal.DebugInfo)1