[HtmlUnit] SVN: [15538] trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/ javascript/host/Set.java
rbri--- via HtmlUnit-develop <[email protected]> Thu, 23 Aug 2018 07:21:43 +0000
| Newsgroups | gmane.comp.java.htmlunit.devel |
|---|---|
| Message-ID | <[email protected]> |
Revision: 15538
http://sourceforge.net/p/htmlunit/code/15538
Author: rbri
Date: 2018-08-23 07:21:40 +0000 (Thu, 23 Aug 2018)
Log Message:
-----------
switch to rhino for the typed arrays
Modified Paths:
--------------
trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Set.java
Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Set.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Set.java 2018-08-23 07:21:10 UTC (rev 15537)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Set.java 2018-08-23 07:21:40 UTC (rev 15538)
@@ -26,7 +26,6 @@
import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor;
import com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction;
import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter;
-import com.gargoylesoftware.htmlunit.javascript.host.arrays.ArrayBufferViewBase;
import net.sourceforge.htmlunit.corejs.javascript.Context;
import net.sourceforge.htmlunit.corejs.javascript.Delegator;
@@ -39,6 +38,7 @@
import net.sourceforge.htmlunit.corejs.javascript.SymbolKey;
import net.sourceforge.htmlunit.corejs.javascript.SymbolScriptable;
import net.sourceforge.htmlunit.corejs.javascript.Undefined;
+import net.sourceforge.htmlunit.corejs.javascript.typedarrays.NativeTypedArrayView;
/**
* A JavaScript object for {@code Set}.
@@ -82,9 +82,9 @@
return;
}
- if (iterable instanceof ArrayBufferViewBase) {
- final ArrayBufferViewBase array = (ArrayBufferViewBase) iterable;
- for (int i = 0; i < array.getLength(); i++) {
+ if (iterable instanceof NativeTypedArrayView) {
+ final NativeTypedArrayView<?> array = (NativeTypedArrayView<?>) iterable;
+ for (int i = 0; i < array.getByteLength() / array.getBytesPerElement(); i++) {
add(ScriptableObject.getProperty(array, i));
}
return;
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot