Skip to content

Commit

Permalink
Fix bug 726116 - Invalid operand for "in" operator returns wrong erro…
Browse files Browse the repository at this point in the history
…r message
  • Loading branch information
hns committed Feb 15, 2012
1 parent d21841d commit 06c5902
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/org/mozilla/javascript/ScriptRuntime.java
Original file line number Diff line number Diff line change
Expand Up @@ -3033,7 +3033,7 @@ public static boolean jsDelegatesTo(Scriptable lhs, Scriptable rhs) {
public static boolean in(Object a, Object b, Context cx)
{
if (!(b instanceof Scriptable)) {
throw typeError0("msg.instanceof.not.object");
throw typeError0("msg.in.not.object");
}

return hasObjectElem((Scriptable)b, a, cx);
Expand Down
5 changes: 4 additions & 1 deletion src/org/mozilla/javascript/resources/Messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -636,11 +636,14 @@ msg.bad.default.value =\
Object''s getDefaultValue() method returned an object.

msg.instanceof.not.object = \
Can''t use instanceof on a non-object.
Can''t use ''instanceof'' on a non-object.

msg.instanceof.bad.prototype = \
''prototype'' property of {0} is not an object.

msg.in.not.object = \
Can''t use ''in'' on a non-object.

msg.bad.radix = \
illegal radix {0}.

Expand Down

0 comments on commit 06c5902

Please sign in to comment.