author | martin |
Wed, 10 Dec 2014 09:23:00 -0800 | |
changeset 28057 | 1a47ceecdba5 |
parent 27524 | f34b84c9f880 |
child 31925 | 85c87bc2f1f3 |
permissions | -rw-r--r-- |
27524
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
1 |
/* |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
2 |
* Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved. |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
4 |
* |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
8 |
* |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
13 |
* accompanied this code). |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
14 |
* |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
18 |
* |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
21 |
* questions. |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
22 |
*/ |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
23 |
|
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
24 |
/** |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
25 |
* JDK-8062799: Binary logical expressions can have numeric types |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
26 |
* |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
27 |
* @test |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
28 |
* @run |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
29 |
*/ |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
30 |
|
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
31 |
(function() { |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
32 |
var inspect = Java.type("jdk.nashorn.test.tools.StaticTypeInspector").inspect; |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
33 |
|
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
34 |
var b = true; |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
35 |
var i = 1; |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
36 |
var l = 4294967296; |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
37 |
var d = 2.1; |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
38 |
var o = "foo"; |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
39 |
|
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
40 |
print(inspect(b || b, "b || b")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
41 |
print(inspect(b || i, "b || i")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
42 |
print(inspect(b || l, "b || l")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
43 |
print(inspect(b || d, "b || d")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
44 |
print(inspect(b || o, "b || o")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
45 |
|
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
46 |
print(inspect(i || b, "i || b")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
47 |
print(inspect(i || i, "i || i")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
48 |
print(inspect(i || l, "i || l")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
49 |
print(inspect(i || d, "i || d")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
50 |
print(inspect(i || o, "i || o")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
51 |
|
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
52 |
print(inspect(l || b, "l || b")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
53 |
print(inspect(l || i, "l || i")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
54 |
print(inspect(l || l, "l || l")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
55 |
print(inspect(l || d, "l || d")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
56 |
print(inspect(l || o, "l || o")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
57 |
|
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
58 |
print(inspect(d || b, "d || b")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
59 |
print(inspect(d || i, "d || i")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
60 |
print(inspect(d || l, "d || l")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
61 |
print(inspect(d || d, "d || d")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
62 |
print(inspect(d || o, "d || o")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
63 |
|
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
64 |
print(inspect(o || b, "o || b")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
65 |
print(inspect(o || i, "o || i")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
66 |
print(inspect(o || l, "o || l")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
67 |
print(inspect(o || d, "o || d")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
68 |
print(inspect(o || o, "o || o")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
69 |
|
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
70 |
print(inspect(b && b, "b && b")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
71 |
print(inspect(b && i, "b && i")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
72 |
print(inspect(b && l, "b && l")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
73 |
print(inspect(b && d, "b && d")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
74 |
print(inspect(b && o, "b && o")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
75 |
|
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
76 |
print(inspect(i && b, "i && b")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
77 |
print(inspect(i && i, "i && i")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
78 |
print(inspect(i && l, "i && l")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
79 |
print(inspect(i && d, "i && d")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
80 |
print(inspect(i && o, "i && o")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
81 |
|
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
82 |
print(inspect(l && b, "l && b")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
83 |
print(inspect(l && i, "l && i")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
84 |
print(inspect(l && l, "l && l")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
85 |
print(inspect(l && d, "l && d")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
86 |
print(inspect(l && o, "l && o")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
87 |
|
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
88 |
print(inspect(d && b, "d && b")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
89 |
print(inspect(d && i, "d && i")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
90 |
print(inspect(d && l, "d && l")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
91 |
print(inspect(d && d, "d && d")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
92 |
print(inspect(d && o, "d && o")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
93 |
|
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
94 |
print(inspect(o && b, "o && b")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
95 |
print(inspect(o && i, "o && i")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
96 |
print(inspect(o && l, "o && l")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
97 |
print(inspect(o && d, "o && d")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
98 |
print(inspect(o && o, "o && o")); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
99 |
})(); |
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
100 |
|
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
101 |
|
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
102 |
|
f34b84c9f880
8062799: Binary logical expressions can have numeric types
attila
parents:
diff
changeset
|
103 |