From e030a17e41fc4bc328b15a5e8acc15248e594708 Mon Sep 17 00:00:00 2001 From: Samuel Plumppu Date: Sat, 28 Jan 2017 01:35:14 +0100 Subject: [PATCH] fix(challenge): Prevent use of String.repeat() in Basic Algorithm. --- .../basic-algorithm-scripting.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/challenges/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting.json b/challenges/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting.json index 5ed6f0b580..c2d3c0323a 100644 --- a/challenges/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting.json +++ b/challenges/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting.json @@ -392,7 +392,8 @@ "assert(repeatStringNumTimes(\"abc\", 4) === \"abcabcabcabc\", 'message: repeatStringNumTimes(\"abc\", 4) should return \"abcabcabcabc\".');", "assert(repeatStringNumTimes(\"abc\", 1) === \"abc\", 'message: repeatStringNumTimes(\"abc\", 1) should return \"abc\".');", "assert(repeatStringNumTimes(\"*\", 8) === \"********\", 'message: repeatStringNumTimes(\"*\", 8) should return \"********\".');", - "assert(repeatStringNumTimes(\"abc\", -2) === \"\", 'message: repeatStringNumTimes(\"abc\", -2) should return \"\".');" + "assert(repeatStringNumTimes(\"abc\", -2) === \"\", 'message: repeatStringNumTimes(\"abc\", -2) should return \"\".');", + "assert(!/\\.repeat/g.test(code), 'message: The built-in repeat()-method should not be used');" ], "type": "bonfire", "isRequired": true, @@ -899,4 +900,4 @@ } } ] -} \ No newline at end of file +}