NASHORN-404.js revision 6:5a1b0714df0e
190380Smsmith/*
290380Smsmith * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
390380Smsmith * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
490380Smsmith *
590380Smsmith * This code is free software; you can redistribute it and/or modify it
690380Smsmith * under the terms of the GNU General Public License version 2 only, as
798146Siwasaki * published by the Free Software Foundation.
898146Siwasaki *
998146Siwasaki * This code is distributed in the hope that it will be useful, but WITHOUT
1098146Siwasaki * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1198146Siwasaki * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1290380Smsmith * version 2 for more details (a copy is included in the LICENSE file that
13193529Sjkim * accompanied this code).
14193529Sjkim *
1590380Smsmith * You should have received a copy of the GNU General Public License version
16123333Snjl * 2 along with this work; if not, write to the Free Software Foundation,
17193529Sjkim * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18193529Sjkim *
19193529Sjkim * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20193529Sjkim * or visit www.oracle.com if you need additional information or have any
2190380Smsmith * questions.
22193529Sjkim */
23193529Sjkim
24193529Sjkim/**
25193529Sjkim * NASHORN-404 : Error.prototype and subtypes do not have any enumerable properties
26193529Sjkim *
27193529Sjkim * @test
28151946Sjkim * @run
29193529Sjkim */
30193529Sjkim
31193529Sjkimfunction check(name) {
32193529Sjkim    var obj = this[name].prototype;
33193529Sjkim    for (i in obj) {
34193529Sjkim        fail("enumerable property: " + name  + ".prototype." + i);
35193529Sjkim    }
36151946Sjkim}
37193529Sjkim
3890380Smsmithcheck("Error");
3990380Smsmithcheck("EvalError");
4090380Smsmithcheck("RangeError");
41193529Sjkimcheck("ReferenceError");
4290380Smsmithcheck("SyntaxError");
4390380Smsmithcheck("URIError");
4490380Smsmith