Skip to content

Commit

Permalink
https://github.com/w3c/FileAPI/issues/41
Browse files Browse the repository at this point in the history
  • Loading branch information
romainmenke committed Jul 14, 2020
1 parent 10f4c17 commit 968a138
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions polyfills/File/polyfill.js
Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion polyfills/File/tests.js
Expand Up @@ -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.
Expand Down

0 comments on commit 968a138

Please sign in to comment.