Here you can find the source of newObject()
public static ScriptObject newObject()
//package com.java2s; /**/* www . jav a 2s .c om*/ * Copyright 2010-2016 Three Crickets LLC. * <p> * The contents of this file are subject to the terms of the Mozilla Public * License version 1.1: http://www.mozilla.org/MPL/MPL-1.1.html * <p> * Alternatively, you can obtain a royalty free commercial license with less * limitations, transferable or non-transferable, directly from Three Crickets * at http://threecrickets.com/ */ import jdk.nashorn.internal.objects.Global; import jdk.nashorn.internal.runtime.ScriptObject; public class Main { public static ScriptObject newObject() { return Global.newEmptyInstance(); } }