JS: polyfill ArrayBuffer.isView in order to support PhantomJS
This commit is contained in:
@@ -31,3 +31,9 @@ if (typeof String.prototype.endsWith === "undefined") {
|
||||
return lastIndex !== -1 && lastIndex === position;
|
||||
};
|
||||
}
|
||||
// For HtmlUnit and PhantomJs
|
||||
if (typeof ArrayBuffer.isView === "undefined") {
|
||||
ArrayBuffer.isView = function(a) {
|
||||
return a != null && a.__proto__ != null && a.__proto__.__proto__ === Int8Array.prototype.__proto__;
|
||||
};
|
||||
}
|
||||
@@ -10,13 +10,6 @@
|
||||
<script src="../../../target/js/lib/kotlin.js"></script>
|
||||
<script src="../../../target/js/lib/kotlin-test-js.js"></script>
|
||||
<script src="../../../target/js/kotlin-js-tests.js"></script>
|
||||
<script> // Polyfill for a missing HtmlUnit method
|
||||
if (!ArrayBuffer.isView) {
|
||||
ArrayBuffer.isView = function () {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script src="deepEqual.js"></script>
|
||||
<script src="swarminject.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user