Skip to content

Commit 0ffa1fd

Browse files
Remove workaround for Nashorn property lookup bug
I confirmed this works from Java 8u45.
1 parent 7fb907a commit 0ffa1fd

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

src/main/js/plugins/alias/alias.js

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,19 +172,12 @@ command('alias', function(params, invoker) {
172172
echo(invoker, 'Usage:\n' + _usage);
173173
return;
174174
}
175-
/*
176-
wph 20140122 this is kind of dumb but Nashorn has some serious problems
177-
accessing object properties by array index notation
178-
in JRE8 alias[operation] returns null - definitely a bug in Nashorn.
179-
*/
180-
for (var key in alias) {
181-
if (key == operation) {
182-
fn = alias[key];
183-
fn(params.slice(1), invoker);
184-
return;
185-
}
175+
176+
if (alias[operation]) {
177+
alias[operation](params.slice(1), invoker);
178+
} else {
179+
echo(invoker, 'Usage:\n' + _usage);
186180
}
187-
echo(invoker, 'Usage:\n' + _usage);
188181
});
189182

190183
var _intercept = function(msg, invoker, exec) {

0 commit comments

Comments
 (0)