nashorn/test/script/basic/JDK-8011209.js
author sundar
Thu, 13 Mar 2014 15:58:24 +0530
changeset 23374 f470afc89c6c
parent 16760 d3a094bca83f
child 24778 2ff5d7041566
permissions -rw-r--r--
8015958: DataView constructor is not defined Reviewed-by: attila, hannesw, lagergren
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16760
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
     1
/*
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
     2
 * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
     4
 * 
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
     7
 * published by the Free Software Foundation.
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
     8
 * 
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    13
 * accompanied this code).
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    14
 * 
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    18
 * 
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    21
 * questions.
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    22
 */
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    23
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    24
/**
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    25
 * JDK-8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    26
 *
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    27
 * @test
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    28
 * @run
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    29
 */
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    30
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    31
var callerPropDesc = Object.getOwnPropertyDescriptor(function(){"use strict"},"caller");
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    32
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    33
var getterLen = callerPropDesc.get.length;
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    34
if (getterLen != 0) {
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    35
    fail("caller's get.length != 0");
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    36
}
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    37
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    38
var setterLen = callerPropDesc.set.length;
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    39
if (setterLen != 0) {
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    40
    fail("caller's set.length != 1");
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    41
}
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    42
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    43
var argumentsPropDesc = Object.getOwnPropertyDescriptor(function(){"use strict"},"arguments");
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    44
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    45
getterLen = argumentsPropDesc.get.length;
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    46
if (getterLen != 0) {
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    47
    fail("arguments's get.length != 0");
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    48
}
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    49
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    50
setterLen = argumentsPropDesc.set.length;
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    51
if (setterLen != 0) {
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    52
    fail("arguments's set.length != 1");
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    53
}
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    54
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    55
var strictArgs = (function() { 'use strict'; return arguments; })();
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    56
callerPropDesc = Object.getOwnPropertyDescriptor(strictArgs,"caller");
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    57
getterLen = callerPropDesc.get.length;
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    58
if (getterLen != 0) {
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    59
    fail("argument.caller's get.length != 0");
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    60
}
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    61
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    62
setterLen = callerPropDesc.set.length;
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    63
if (setterLen != 0) {
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    64
    fail("argument.caller's set.length != 1");
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    65
}
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    66
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    67
calleePropDesc = Object.getOwnPropertyDescriptor(strictArgs,"callee");
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    68
getterLen = calleePropDesc.get.length;
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    69
if (getterLen != 0) {
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    70
    fail("argument.callee's get.length != 0");
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    71
}
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    72
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    73
setterLen = calleePropDesc.set.length;
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    74
if (setterLen != 0) {
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    75
    fail("argument.callee's set.length != 1");
d3a094bca83f 8011209: Object.getOwnPropertyDescriptor(function(){"use strict"},"caller").get.length is not 0
sundar
parents:
diff changeset
    76
}