sundar@77: /* sundar@77: * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. sundar@77: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. attila@962: * sundar@77: * This code is free software; you can redistribute it and/or modify it sundar@77: * under the terms of the GNU General Public License version 2 only, as sundar@77: * published by the Free Software Foundation. attila@962: * sundar@77: * This code is distributed in the hope that it will be useful, but WITHOUT sundar@77: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or sundar@77: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License sundar@77: * version 2 for more details (a copy is included in the LICENSE file that sundar@77: * accompanied this code). attila@962: * sundar@77: * You should have received a copy of the GNU General Public License version sundar@77: * 2 along with this work; if not, write to the Free Software Foundation, sundar@77: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. attila@962: * sundar@77: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA sundar@77: * or visit www.oracle.com if you need additional information or have any sundar@77: * questions. sundar@77: */ sundar@77: sundar@77: /** sundar@77: * Check that nashorn mozilla compatibility script can be loaded in sandbox. sundar@77: * sundar@77: * @test sundar@77: * @run sundar@77: * @security sundar@77: */ sundar@77: sundar@77: load("nashorn:mozilla_compat.js"); sundar@77: sundar@77: var obj = {}; sundar@77: if (obj.__proto__ !== Object.prototype) { sundar@77: fail("__proto__ does not work as expected"); sundar@77: } sundar@77: sundar@77: var array = []; sundar@77: if (array.__proto__ !== Array.prototype) { sundar@77: fail("__proto__ does not work as expected"); sundar@77: } sundar@77: sundar@77: if (typeof JavaAdapter != 'function') { sundar@77: fail("JavaAdapter constructor is missing in compatibility script"); sundar@77: } sundar@77: sundar@77: if (typeof importPackage != 'function') { sundar@77: fail("importPackage function is missing in compatibility script"); sundar@77: } hannesw@623: hannesw@623: if (typeof sync != 'function') { hannesw@623: fail("sync function is missing in compatibility script"); hannesw@623: }