package com.winterbe.java8;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import java.io.FileReader;

/**
 * Working with java types from javascript.
 *
 * @author Benjamin Winterberg
 */
public class Nashorn3 {

    public static void main(String[] args) throws Exception {
        ScriptEngine engine = new ScriptEngineManager().getEngineByName("nashorn");
        engine.eval(new FileReader("res/nashorn3.js"));
    }

}
@@ -100,35 +100,8 @@
 ger;
-%0Aimport java.io.FileReader;
 %0A%0A/*
@@ -379,24 +379,15 @@
 val(
-new FileReader(%22
+%22load('
 res/
@@ -397,18 +397,19 @@
 horn3.js
+')
 %22
-)
 );%0A    %7D

use load function