mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-15 08:34:30 +02:00
8072426: Can't compare Java objects to strings or numbers
Reviewed-by: hannesw, lagergren, sundar
This commit is contained in:
parent
f3a755b2ab
commit
0a6d13699b
11 changed files with 380 additions and 102 deletions
|
@ -102,7 +102,18 @@ print(jlist instanceof java.util.List);
|
|||
print(jlist);
|
||||
|
||||
var obj = new JSObject() {
|
||||
toNumber: function() { return 42; }
|
||||
getMember: function(name) {
|
||||
if (name == "valueOf") {
|
||||
return new JSObject() {
|
||||
isFunction: function() {
|
||||
return true;
|
||||
},
|
||||
call: function(thiz) {
|
||||
return 42;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
print(32 + obj);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue