Here you can find the source of addToNativeObject(final Object object, final String key, final Object value)
public static void addToNativeObject(final Object object, final String key, final Object value)
//package com.java2s; //License from project: Open Source License import jdk.nashorn.internal.runtime.ScriptObject; public class Main { public static void addToNativeObject(final Object object, final String key, final Object value) { ((ScriptObject) object).put(key, value, false); }/* ww w. j a va 2 s .c om*/ }