Skip to content

Commit 6032c4b

Browse files
committed
cleanup
1 parent c79dccd commit 6032c4b

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/main/java/org/htmlunit/javascript/host/canvas/ImageData.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import org.htmlunit.corejs.javascript.Function;
1919
import org.htmlunit.corejs.javascript.Scriptable;
2020
import org.htmlunit.corejs.javascript.ScriptableObject;
21-
import org.htmlunit.corejs.javascript.TopLevel;
2221
import org.htmlunit.corejs.javascript.typedarrays.NativeArrayBuffer;
2322
import org.htmlunit.corejs.javascript.typedarrays.NativeUint8ClampedArray;
2423
import org.htmlunit.javascript.HtmlUnitScriptable;
@@ -73,7 +72,7 @@ public static ImageData jsConstructor(final Context cx, final Scriptable scope,
7372
data = array;
7473
if (data.getArrayLength() % 4 != 0) {
7574
throw JavaScriptEngine.asJavaScriptException(
76-
(HtmlUnitScriptable) ((TopLevel) JavaScriptEngine.getTopCallScope()).getGlobalThis(),
75+
(HtmlUnitScriptable) JavaScriptEngine.getTopCallScope().getGlobalThis(),
7776
"ImageData ctor - data length mod 4 not zero",
7877
DOMException.INVALID_STATE_ERR);
7978
}
@@ -84,7 +83,7 @@ public static ImageData jsConstructor(final Context cx, final Scriptable scope,
8483

8584
if (data.getArrayLength() != 4 * width * height) {
8685
throw JavaScriptEngine.asJavaScriptException(
87-
(HtmlUnitScriptable) ((TopLevel) JavaScriptEngine.getTopCallScope()).getGlobalThis(),
86+
(HtmlUnitScriptable) JavaScriptEngine.getTopCallScope().getGlobalThis(),
8887
"ImageData ctor - width not correct",
8988
DOMException.INDEX_SIZE_ERR);
9089
}
@@ -95,7 +94,7 @@ public static ImageData jsConstructor(final Context cx, final Scriptable scope,
9594

9695
if (data.getArrayLength() != 4 * width * height) {
9796
throw JavaScriptEngine.asJavaScriptException(
98-
(HtmlUnitScriptable) ((TopLevel) JavaScriptEngine.getTopCallScope()).getGlobalThis(),
97+
(HtmlUnitScriptable) JavaScriptEngine.getTopCallScope().getGlobalThis(),
9998
"ImageData ctor - width/height not correct",
10099
DOMException.INDEX_SIZE_ERR);
101100
}
@@ -107,13 +106,13 @@ public static ImageData jsConstructor(final Context cx, final Scriptable scope,
107106

108107
if (width < 0) {
109108
throw JavaScriptEngine.asJavaScriptException(
110-
(HtmlUnitScriptable) ((TopLevel) JavaScriptEngine.getTopCallScope()).getGlobalThis(),
109+
(HtmlUnitScriptable) JavaScriptEngine.getTopCallScope().getGlobalThis(),
111110
"ImageData ctor - width negative",
112111
DOMException.INDEX_SIZE_ERR);
113112
}
114113
if (height < 0) {
115114
throw JavaScriptEngine.asJavaScriptException(
116-
(HtmlUnitScriptable) ((TopLevel) JavaScriptEngine.getTopCallScope()).getGlobalThis(),
115+
(HtmlUnitScriptable) JavaScriptEngine.getTopCallScope().getGlobalThis(),
117116
"ImageData ctor - height negative",
118117
DOMException.INDEX_SIZE_ERR);
119118
}

0 commit comments

Comments
 (0)