nashorn/test/script/basic/JDK-8023784.js
author sundar
Thu, 13 Mar 2014 15:58:24 +0530
changeset 23374 f470afc89c6c
parent 19638 bf08be79957a
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:
19638
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
     1
/*
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
     2
 * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
     4
 * 
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
     7
 * published by the Free Software Foundation.
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
     8
 * 
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    13
 * accompanied this code).
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    14
 * 
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    18
 * 
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    21
 * questions.
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    22
 */
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    23
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    24
/**
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    25
 * JDK-8023784: Object.prototype.toString should contain the class name for all instances
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    26
 *
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    27
 * @test
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    28
 * @run
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    29
 */
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    30
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    31
// two parts to this bug -- typed array don't have proper [[Class]] property
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    32
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    33
print(Object.prototype.toString.call(new ArrayBuffer(1)));
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    34
print(Object.prototype.toString.call(new Int8Array(1)));
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    35
print(Object.prototype.toString.call(new Int16Array(1)));
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    36
print(Object.prototype.toString.call(new Int32Array(1)));
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    37
print(Object.prototype.toString.call(new Uint8Array(1)));
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    38
print(Object.prototype.toString.call(new Uint8ClampedArray(1)));
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    39
print(Object.prototype.toString.call(new Uint16Array(1)));
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    40
print(Object.prototype.toString.call(new Uint32Array(1)));
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    41
print(Object.prototype.toString.call(new Float32Array(1)));
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    42
print(Object.prototype.toString.call(new Float64Array(1)));
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    43
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    44
// second part is that Object.prototype.toString does not handle mirror
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    45
// in the manner expected.
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    46
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    47
var global = loadWithNewGlobal({
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    48
    name: "test",
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    49
    script: "this"
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    50
});
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    51
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    52
print(Object.prototype.toString.call(new global.Object()));
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    53
print(Object.prototype.toString.call(new global.Array()));
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    54
print(Object.prototype.toString.call(new global.RegExp()));
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    55
print(Object.prototype.toString.call(new global.Error("error!")));
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    56
print(Object.prototype.toString.call(global.Object));
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    57
print(Object.prototype.toString.call(new global.ArrayBuffer(1)));
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    58
print(Object.prototype.toString.call(new global.Int8Array(1)));
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    59
print(Object.prototype.toString.call(new global.Int16Array(1)));
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    60
print(Object.prototype.toString.call(new global.Int32Array(1)));
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    61
print(Object.prototype.toString.call(new global.Uint8Array(1)));
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    62
print(Object.prototype.toString.call(new global.Uint8ClampedArray(1)));
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    63
print(Object.prototype.toString.call(new global.Uint16Array(1)));
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    64
print(Object.prototype.toString.call(new global.Uint32Array(1)));
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    65
print(Object.prototype.toString.call(new global.Float32Array(1)));
bf08be79957a 8023784: Object.prototype.toString should contain the class name for all instances
sundar
parents:
diff changeset
    66
print(Object.prototype.toString.call(new global.Float64Array(1)));