diff --git a/src/org/mozilla/javascript/EqualObjectGraphs.java b/src/org/mozilla/javascript/EqualObjectGraphs.java index 42a9ce2f01..076298f010 100644 --- a/src/org/mozilla/javascript/EqualObjectGraphs.java +++ b/src/org/mozilla/javascript/EqualObjectGraphs.java @@ -16,6 +16,9 @@ import java.util.SortedMap; import java.util.TreeMap; import org.mozilla.javascript.debug.DebuggableObject; +import org.mozilla.javascript.typedarrays.NativeArrayBuffer; +import org.mozilla.javascript.typedarrays.NativeArrayBufferView; +import org.mozilla.javascript.typedarrays.NativeTypedArrayView; /** * An object that implements deep equality test of objects, including their @@ -307,7 +310,18 @@ private static String getSymbolName(final Symbol s) { private static Object[] getIds(final Scriptable s) { if (s instanceof ScriptableObject) { // Grabs symbols too - return ((ScriptableObject)s).getIds(true, true); + try { + return ((ScriptableObject)s).getIds(true, true); + } catch (IllegalArgumentException e) { + if (s instanceof NativeArrayBuffer) { + // TODO: remove this once https://github.com/mozilla/rhino/issues/437 is fixed + return new String[0]; + } else if (s instanceof NativeTypedArrayView) { + // TODO: remove this once https://github.com/mozilla/rhino/issues/449 is fixed + return s.getIds(); + } + throw e; + } } else if (s instanceof DebuggableObject) { return ((DebuggableObject)s).getAllIds(); } else {