From 968a1387c8b89be5e0d383ffb7e862eb2637e73d Mon Sep 17 00:00:00 2001 From: romainmenke Date: Tue, 14 Jul 2020 06:59:19 +0200 Subject: [PATCH] https://github.com/w3c/FileAPI/issues/41 --- polyfills/File/polyfill.js | 8 ++++++-- polyfills/File/tests.js | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/polyfills/File/polyfill.js b/polyfills/File/polyfill.js index 2bd2b20fe..f6c9ed263 100644 --- a/polyfills/File/polyfill.js +++ b/polyfills/File/polyfill.js @@ -50,8 +50,12 @@ // Not our concern here. // 4.1.2 https://w3c.github.io/FileAPI/#file-constructor - // Let n be a new string of the same size as the fileName argument to the constructor. Copy every character from fileName to n, replacing any "/" character (U+002F SOLIDUS) with a ":" (U+003A COLON). - var n = fileName.toString().replace(/\//g, ':'); + // Let n be a new string of the same size as the fileName argument to the constructor. + // + // Copy every character from fileName to n, replacing any "/" character (U+002F SOLIDUS) with a ":" (U+003A COLON). + // WARNING : This part of the spec is still debated and UA's implement inconsistently. https://github.com/w3c/FileAPI/issues/41 + // When spec settles maybe add : .replace(/\//g, ':') + var n = fileName.toString(); var options; if (2 < arguments.length) { diff --git a/polyfills/File/tests.js b/polyfills/File/tests.js index 7126c09b2..d4efbef7a 100644 --- a/polyfills/File/tests.js +++ b/polyfills/File/tests.js @@ -54,7 +54,8 @@ describe('File', function() { proclaim.equal(e.name, 'stringer'); }); - // https://bugs.chromium.org/p/chromium/issues/detail?id=1105171 + // Chromium issue : https://bugs.chromium.org/p/chromium/issues/detail?id=1105171 + // Spec debate : https://github.com/w3c/FileAPI/issues/41 // it("implements .name escaping", function () { // // 4.1.2 https://w3c.github.io/FileAPI/#file-constructor // // Let n be a new string of the same size as the fileName argument to the constructor.