JDK-8011274.js revision 877:cf4d2252d444
152419Sjulian/* 252419Sjulian * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. 3139823Simp * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4139823Simp * 5139823Simp * This code is free software; you can redistribute it and/or modify it 652419Sjulian * under the terms of the GNU General Public License version 2 only, as 752419Sjulian * published by the Free Software Foundation. 852419Sjulian * 952419Sjulian * This code is distributed in the hope that it will be useful, but WITHOUT 1052419Sjulian * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1152419Sjulian * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1252419Sjulian * version 2 for more details (a copy is included in the LICENSE file that 1352419Sjulian * accompanied this code). 1452419Sjulian * 1552419Sjulian * You should have received a copy of the GNU General Public License version 1652419Sjulian * 2 along with this work; if not, write to the Free Software Foundation, 1752419Sjulian * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1852419Sjulian * 1952419Sjulian * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2052419Sjulian * or visit www.oracle.com if you need additional information or have any 2152419Sjulian * questions. 2252419Sjulian */ 2352419Sjulian 2452419Sjulian/** 2552419Sjulian * JDK-8011324: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.hasOwnProperty("prototype") should be false 2652419Sjulian * 2752419Sjulian * @test 2852419Sjulian * @run 2952419Sjulian */ 3052419Sjulian 3152419Sjulianvar strictFunc = (function() { 'use strict' }); 3252419Sjulianvar desc = Object.getOwnPropertyDescriptor(strictFunc, "caller"); 3352419Sjulianif (desc.get.hasOwnProperty("prototype")) { 3452419Sjulian fail("strict function's caller getter has 'prototype' property"); 3552419Sjulian} 3652419Sjulian 3752419Sjulian// try few built-ins 3867506Sjulianif (parseInt.hasOwnProperty("prototype")) { 3952419Sjulian fail("parseInt.hasOwnProperty('prototype') is true"); 4052419Sjulian} 4152419Sjulian 4252419Sjulianif (parseFloat.hasOwnProperty("prototype")) { 4352419Sjulian fail("parseFloat.hasOwnProperty('prototype') is true"); 44122481Sru} 45122481Sru 4652419Sjulianif (isFinite.hasOwnProperty("prototype")) { 4752419Sjulian fail("isFinite.hasOwnProperty('prototype') is true"); 4852419Sjulian} 4952419Sjulian