test/script/sandbox/classbind.js

Wed, 05 Sep 2018 01:21:35 -0700

author
diazhou
date
Wed, 05 Sep 2018 01:21:35 -0700
changeset 2374
037913b52507
parent 962
ac62e33a99b0
child 1205
4112748288bb
permissions
-rw-r--r--

Added tag jdk8u192-b09 for changeset 456c0d45c43b

sundar@716 1 /*
sundar@716 2 * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
sundar@716 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
attila@962 4 *
sundar@716 5 * This code is free software; you can redistribute it and/or modify it
sundar@716 6 * under the terms of the GNU General Public License version 2 only, as
sundar@716 7 * published by the Free Software Foundation.
attila@962 8 *
sundar@716 9 * This code is distributed in the hope that it will be useful, but WITHOUT
sundar@716 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
sundar@716 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
sundar@716 12 * version 2 for more details (a copy is included in the LICENSE file that
sundar@716 13 * accompanied this code).
attila@962 14 *
sundar@716 15 * You should have received a copy of the GNU General Public License version
sundar@716 16 * 2 along with this work; if not, write to the Free Software Foundation,
sundar@716 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
attila@962 18 *
sundar@716 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
sundar@716 20 * or visit www.oracle.com if you need additional information or have any
sundar@716 21 * questions.
sundar@716 22 */
sundar@716 23
sundar@716 24 /**
sundar@716 25 * Try to bind properties of StaticClass representing Class.
sundar@716 26 *
sundar@716 27 * @test
sundar@717 28 * @bug JDK-8032943: Improve reflection in Nashorn
sundar@716 29 */
sundar@716 30
sundar@716 31
sundar@716 32 var obj = {}
sundar@716 33
sundar@716 34 try {
sundar@716 35 Object.bindProperties(obj, Java.type("java.lang.Class"));
sundar@716 36 fail("SecurityException should have been thrown");
sundar@716 37 } catch (e) {
sundar@716 38 if (! (e instanceof java.lang.SecurityException)) {
sundar@716 39 fail("SecurityException expected, got " + e);
sundar@716 40 }
sundar@716 41 }

mercurial