From 123d586e52bb48605db4665f453fc1ffc8c87a22 Mon Sep 17 00:00:00 2001 From: wolframkriesing Date: Mon, 30 Oct 2023 20:40:43 +0100 Subject: [PATCH] They all moved to es5 --- katas/es5.1/language/__all__.json | 67 ------------------- katas/es5.1/language/__grouped__.json | 71 --------------------- katas/es5.1/language/function-api/bind.js | 27 -------- katas/es5.1/language/function-api/length.js | 14 ---- 4 files changed, 179 deletions(-) delete mode 100644 katas/es5.1/language/__all__.json delete mode 100644 katas/es5.1/language/__grouped__.json delete mode 100644 katas/es5.1/language/function-api/bind.js delete mode 100644 katas/es5.1/language/function-api/length.js diff --git a/katas/es5.1/language/__all__.json b/katas/es5.1/language/__all__.json deleted file mode 100644 index 4c50e27..0000000 --- a/katas/es5.1/language/__all__.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "ECMAScript 5.1", - "nameSlug": "es5.1-katas", - "items": [ - { - "name": "`function.bind()`", - "description": "The `bind()` method creates a new function with a given scope and optionally parameter(s).", - "path": "function-api/bind", - "level": "ADVANCED", - "requiresKnowledgeFrom": [], - "links": [ - { - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind", - "comment": "The MDN docs about `bind()`.", - "tags": [ - "mdn", - "docs" - ] - }, - { - "url": "https://262.ecma-international.org/5.1/#sec-15.3.4.5", - "comment": "The ECMAScript Language Specification, 5.1 Edition, Section 15.3.4.5, when `bind()` was introduced.", - "tags": [ - "spec" - ] - } - ], - "groupName": "function API", - "groupNameSlug": "function-api", - "publishDateRfc822": "Mon, 16 Oct 2023 19:00:00 GMT", - "id": 1 - }, - { - "name": "`function.length` (using ES5.1 features)", - "description": "The `length` property indicates the number of parameters a function expects.", - "path": "function-api/length", - "level": "BEGINNER", - "requiresKnowledgeFrom": [ - { - "bundle": "es5.1/language", - "id": 1 - } - ], - "links": [ - { - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/length", - "comment": "The MDN docs about `length`.", - "tags": [ - "mdn", - "docs" - ] - }, - { - "url": "https://262.ecma-international.org/5.1/#sec-15.3.5.1", - "comment": "The ECMAScript Language Specification, 5.1 Edition, Section 15.3.5.1.", - "tags": [ - "spec" - ] - } - ], - "groupName": "function API", - "groupNameSlug": "function-api", - "publishDateRfc822": "Wed, 18 Oct 2023 19:00:00 GMT", - "id": 2 - } - ] -} \ No newline at end of file diff --git a/katas/es5.1/language/__grouped__.json b/katas/es5.1/language/__grouped__.json deleted file mode 100644 index 78ddc3b..0000000 --- a/katas/es5.1/language/__grouped__.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "ECMAScript 5.1", - "nameSlug": "es5.1-katas", - "groups": { - "function API": { - "items": [ - { - "name": "`function.bind()`", - "description": "The `bind()` method creates a new function with a given scope and optionally parameter(s).", - "path": "function-api/bind", - "level": "ADVANCED", - "requiresKnowledgeFrom": [], - "publishDateUTC": "2023-10-16T19:00:00.000Z", - "links": [ - { - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind", - "comment": "The MDN docs about `bind()`.", - "tags": [ - "mdn", - "docs" - ] - }, - { - "url": "https://262.ecma-international.org/5.1/#sec-15.3.4.5", - "comment": "The ECMAScript Language Specification, 5.1 Edition, Section 15.3.4.5, when `bind()` was introduced.", - "tags": [ - "spec" - ] - } - ], - "groupName": "function API", - "id": "1" - }, - { - "name": "`function.length` (using ES5.1 features)", - "description": "The `length` property indicates the number of parameters a function expects.", - "path": "function-api/length", - "level": "BEGINNER", - "requiresKnowledgeFrom": [ - { - "bundle": "es5.1/language", - "id": 1 - } - ], - "publishDateUTC": "2023-10-18T19:00:00.000Z", - "links": [ - { - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/length", - "comment": "The MDN docs about `length`.", - "tags": [ - "mdn", - "docs" - ] - }, - { - "url": "https://262.ecma-international.org/5.1/#sec-15.3.5.1", - "comment": "The ECMAScript Language Specification, 5.1 Edition, Section 15.3.5.1.", - "tags": [ - "spec" - ] - } - ], - "groupName": "function API", - "id": "2" - } - ], - "slug": "function-api", - "name": "function API" - } - } -} \ No newline at end of file diff --git a/katas/es5.1/language/function-api/bind.js b/katas/es5.1/language/function-api/bind.js deleted file mode 100644 index c404a99..0000000 --- a/katas/es5.1/language/function-api/bind.js +++ /dev/null @@ -1,27 +0,0 @@ -describe('Using `fn.bind()` creates a new function with scope (and parameters) pre-configured', () => { - describe('GIVEN we bind a scope to a function', () => { - it('WHEN we call the bound function with a custom object THEN the scope of `this` refers to the given object', () => { - const fn = function() { - return this.myScopeVariable; - }; - const boundFn = fn.bind({myScopeVariable: 'forty-two'}); - assert.strictEqual(boundFn(), 'forty-two'); - }); - it('WHEN binding a string to String\'s `toUpperCase` THEN calling the resulting function returns the upper case value of the string', () => { - const yell = String.prototype.toUpperCase.bind('hello'); - assert.strictEqual(yell(), 'HELLO'); - }); - it('WHEN binding Array\'s `slice()` method THEN array-like values can dynamically be converted to an array', () => { - const arrayLike = {length: 1, 0: 'a'}; - const toArray = function (a) { return Array.prototype.slice.bind(a)(); }; - assert.deepStrictEqual(toArray(arrayLike), ['a']); - }); - }); - describe('GIVEN we bind parameters to a function', () => { - it('WHEN binding the first parameter of a function THEN the bound function can be called just with the seconds parameter', () => { - const add = function(a, b) { return a + b; }; - const add5 = add.bind(null, 5); - assert.strictEqual(add5(10), 15); - }); - }); -}); \ No newline at end of file diff --git a/katas/es5.1/language/function-api/length.js b/katas/es5.1/language/function-api/length.js deleted file mode 100644 index f642292..0000000 --- a/katas/es5.1/language/function-api/length.js +++ /dev/null @@ -1,14 +0,0 @@ -describe('The property `function.length` indicates the number of parameters a function expects', () => { - describe('GIVEN we read the `length` from a bound function', () => { - it('WHEN binding a function with 3 parameters THEN the bound value has still a `length` of 3', () => { - const fn = function(a, b, c) {}; - const boundFn = fn.____(null); - assert.equal(boundFn.length, 3); - }); - it('WHEN binding a function (that expects three parameters) with one parameter THEN the `length` will reduced by 1, it will be 2', () => { - const fn = function(a, b, c) {}; - const boundFn = fn.bind(null, 1, 2, 3); - assert.equal(boundFn.length, 2); - }); - }); -});