Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ const ignores = [
"polyfills/fetch/polyfill.js",
"polyfills/smoothscroll/polyfill.js",
"polyfills/~html5-elements/polyfill.js",
"polyfills/URL/polyfill.js",
"polyfills/_IteratorHelpers/polyfill.js",

// Vendored mocha
Expand Down
24 changes: 12 additions & 12 deletions polyfills/Blob/polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
var FBB_proto = FakeBlobBuilder.prototype;
var FB_proto = FakeBlob.prototype;
var FileReaderSync = view.FileReaderSync;
var FileException = function (type) {
var FileException = function FileException(type) {
this.code = this[this.name = type];
};
var file_ex_codes = (
Expand All @@ -62,7 +62,7 @@
}
// Polyfill URL
if (!view.URL) {
URL = view.URL = function (uri) {
URL = view.URL = function URL(uri) {
var
uri_info = document.createElementNS("http://www.w3.org/1999/xhtml", "a"),
uri_origin;
Expand All @@ -79,7 +79,7 @@
};
}

URL.createObjectURL = function (blob) {
URL.createObjectURL = function createObjectURL(blob) {
var
type = blob.type,
data_URI_header;
Expand All @@ -102,12 +102,12 @@
return real_create_object_URL.call(real_URL, blob);
}
};
URL.revokeObjectURL = function (object_URL) {
URL.revokeObjectURL = function revokeObjectURL(object_URL) {
if (object_URL.substring(0, 5) !== "data:" && real_revoke_object_URL) {
real_revoke_object_URL.call(real_URL, object_URL);
}
};
FBB_proto.append = function (data /*, endings*/ ) {
FBB_proto.append = function append(data /*, endings*/ ) {
var bb = this.data;
// decode data to a binary string
if (Uint8Array && (data instanceof ArrayBuffer || data instanceof Uint8Array)) {
Expand Down Expand Up @@ -144,16 +144,16 @@
bb.push(unescape(encodeURIComponent(data)));
}
};
FBB_proto.getBlob = function (type) {
FBB_proto.getBlob = function getBlob(type) {
if (!arguments.length) {
type = null;
}
return new FakeBlob(this.data.join(""), type, "raw");
};
FBB_proto.toString = function () {
FBB_proto.toString = function toString() {
return "[object BlobBuilder]";
};
FB_proto.slice = function () {
FB_proto.slice = function slice() {
var start = arguments[0];
var end = arguments[1];
var type = arguments[2];
Expand All @@ -166,10 +166,10 @@
this.data.slice(start, args > 1 ? end : this.data.length), type, this.encoding
);
};
FB_proto.toString = function () {
FB_proto.toString = function toString() {
return "[object Blob]";
};
FB_proto.close = function () {
FB_proto.close = function close() {
this.size = 0;
delete this.data;
};
Expand Down Expand Up @@ -197,7 +197,7 @@
}
}());

view.Blob = function () {
view.Blob = function Blob() {
var blobParts = arguments[0];
var options = arguments[1];

Expand Down Expand Up @@ -235,7 +235,7 @@
return blob;
};

var getPrototypeOf = Object.getPrototypeOf || function (object) {
var getPrototypeOf = Object.getPrototypeOf || function getPrototypeOf(object) {
return object.__proto__;
};
view.Blob.prototype = getPrototypeOf(new view.Blob());
Expand Down
19 changes: 14 additions & 5 deletions polyfills/URL/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ aliases = [
"URLSearchParams"
]
dependencies = [
"_ESAbstract.CreateMethodProperty",
"Array.from",
"Array.prototype.@@iterator",
"Array.prototype.entries",
Expand All @@ -27,6 +28,19 @@ dependencies = [
"String.prototype.startsWith",
"TextEncoder",
"TypedArray.prototype.@@iterator",
"_data._tr46_bidiDomain",
"_data._tr46_bidiS1LTR",
"_data._tr46_bidiS1RTL",
"_data._tr46_bidiS2",
"_data._tr46_bidiS3",
"_data._tr46_bidiS4AN",
"_data._tr46_bidiS4EN",
"_data._tr46_bidiS5",
"_data._tr46_bidiS6",
"_data._tr46_combiningClassVirama",
"_data._tr46_combiningMarks",
"_data._tr46_mappingTable",
"_data._tr46_validZWNJ",
]
notes = [ ]
license = "MIT"
Expand All @@ -49,8 +63,3 @@ op_mini = "*"
safari = "<12.0"
ios_saf = "<12.0"
samsung_mob = "<5.0"

[install]
module = "whatwg-url"
postinstall = "update.task.js"
clean = [ "polyfill.js" ]
7 changes: 0 additions & 7 deletions polyfills/URL/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
"name": "@mrhenry/polyfill-library--url",
"version": "0.0.0",
"private": true,
"devDependencies": {
"@babel/core": "7.24.7",
"@babel/preset-env": "7.24.7",
"babelify": "10.0.0",
"browserify": "17.0.0",
"whatwg-url": "14.0.0"
},
"volta": {
"extends": "../../package.json"
}
Expand Down
Loading
Loading