JDK-8032004.js revision 713:341f81ebefe0
1130561Sobrien/*
2130561Sobrien * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
3130561Sobrien * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4130561Sobrien *
5130561Sobrien * This code is free software; you can redistribute it and/or modify it
6130561Sobrien * under the terms of the GNU General Public License version 2 only, as
7130561Sobrien * published by the Free Software Foundation.
8130561Sobrien *
9130561Sobrien * This code is distributed in the hope that it will be useful, but WITHOUT
10130561Sobrien * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11130561Sobrien * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12130561Sobrien * version 2 for more details (a copy is included in the LICENSE file that
13130561Sobrien * accompanied this code).
14130561Sobrien *
15130561Sobrien * You should have received a copy of the GNU General Public License version
16130561Sobrien * 2 along with this work; if not, write to the Free Software Foundation,
17130561Sobrien * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18130561Sobrien *
19130561Sobrien * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20130561Sobrien * or visit www.oracle.com if you need additional information or have any
21130561Sobrien * questions.
22130561Sobrien */
23130561Sobrien
24130561Sobrien/**
25130561Sobrien * JDK-8032004: instance property "message" of Error objects should be non-enumerable
26130561Sobrien *
27130561Sobrien * @test
28218822Sdim * @run
29130561Sobrien */
30130561Sobrien
31130561Sobrienfunction check(obj) {
32130561Sobrien    if (obj.propertyIsEnumerable("message")) {
33130561Sobrien        fail(obj.name + " object's message property is enumerable!");
34130561Sobrien    }
35130561Sobrien}
36130561Sobrien
37130561Sobriencheck(new Error("test"));
38130561Sobriencheck(new EvalError("test"));
39130561Sobriencheck(new RangeError("test"));
40130561Sobriencheck(new ReferenceError("test"));
41130561Sobriencheck(new SyntaxError("test"));
42130561Sobriencheck(new TypeError("test"));
43130561Sobriencheck(new URIError("test"));
44130561Sobrien