Search in sources :

Example 11 with SystemConsole

use of com.github.anba.es6draft.util.SystemConsole in project es6draft by anba.

the class Test262Parser method runTest.

@Test
public void runTest() throws Throwable {
    RuntimeContext context = realms.newContext(new SystemConsole(), test);
    ScriptLoader loader = new ScriptLoader(context);
    Source source = new Source(test.toFile(), test.getScript().toString(), 1);
    String sourceCode = new String(Files.readAllBytes(test.toFile()), StandardCharsets.UTF_8);
    if (test.isModule()) {
        loader.parseModule(source, sourceCode);
    } else {
        loader.parseScript(source, sourceCode);
    }
}
Also used : RuntimeContext(com.github.anba.es6draft.runtime.internal.RuntimeContext) SystemConsole(com.github.anba.es6draft.util.SystemConsole) ScriptLoader(com.github.anba.es6draft.runtime.internal.ScriptLoader) Source(com.github.anba.es6draft.runtime.internal.Source) Test(org.junit.Test)

Aggregations

SystemConsole (com.github.anba.es6draft.util.SystemConsole)11 Before (org.junit.Before)10 Timers (com.github.anba.es6draft.runtime.extensions.timer.Timers)3 RuntimeContext (com.github.anba.es6draft.runtime.internal.RuntimeContext)1 ScriptLoader (com.github.anba.es6draft.runtime.internal.ScriptLoader)1 Source (com.github.anba.es6draft.runtime.internal.Source)1 UnhandledRejectionException (com.github.anba.es6draft.runtime.internal.UnhandledRejectionException)1 Test (org.junit.Test)1