nashorn/test/script/basic/JDK-8011237.js
author sundar
Fri, 05 Jul 2013 14:38:04 +0530
changeset 18851 bdb92c95f886
parent 16765 db06a4c494bb
child 24778 2ff5d7041566
permissions -rw-r--r--
8019947: inherited property invalidation does not work with two globals in same context Reviewed-by: jlaskey, lagergren, hannesw, attila
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16765
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
     1
/*
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
     2
 * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
     4
 * 
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
     7
 * published by the Free Software Foundation.
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
     8
 * 
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    13
 * accompanied this code).
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    14
 * 
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    18
 * 
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    21
 * questions.
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    22
 */
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    23
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    24
/**
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    25
 * JDK-8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    26
 *
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    27
 * @test
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    28
 * @run
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    29
 */
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    30
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    31
// ECMA Section 13.2.3 The [[ThrowTypeError]] Function Object
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    32
// 11. Set the [[Extensible]] internal property of F to false
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    33
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    34
var strictFunc = (function() { 'use strict' });
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    35
var strictFuncCallerDesc = Object.getOwnPropertyDescriptor(strictFunc, "caller")
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    36
var isExtensible = Object.isExtensible(strictFuncCallerDesc.get);
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    37
if (isExtensible) {
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    38
    fail("strict function caller's getter is extensible!");
db06a4c494bb 8011237: Object.isExtensible(Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get) should be false
sundar
parents:
diff changeset
    39
}