From 1627faf2f08e29b8c442752e8b55bccdfabf8364 Mon Sep 17 00:00:00 2001 From: Dieter Daems Date: Thu, 31 Dec 2015 14:17:07 +0100 Subject: [PATCH] Fix stack trace error in javascript challenge - added a additional check to make sure the function exists --- .../basic-javascript.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/challenges/01-front-end-development-certification/basic-javascript.json b/challenges/01-front-end-development-certification/basic-javascript.json index dcf7274e6f..195b23e42b 100644 --- a/challenges/01-front-end-development-certification/basic-javascript.json +++ b/challenges/01-front-end-development-certification/basic-javascript.json @@ -1841,8 +1841,8 @@ ], "tests": [ "assert(typeof myFunction === 'function', 'message: myFunction should be a function');", - "capture(); myFunction(1,2); uncapture(); assert(logOutput == 3, 'message: myFunction(1,2) should output 3');", - "capture(); myFunction(7,9); uncapture(); assert(logOutput == 16, 'message: myFunction(7,9) should output 16');", + "if(typeof myFunction === \"function\") { capture(); myFunction(1,2); uncapture(); } assert(logOutput == 3, 'message: myFunction(1,2) should output 3');", + "if(typeof myFunction === \"function\") { capture(); myFunction(7,9); uncapture(); } assert(logOutput == 16, 'message: myFunction(7,9) should output 16');", "assert(/^\\s*myFunction\\(\\s*\\d+\\s*,\\s*\\d+\\s*\\)\\s*;/m.test(code), 'message: Call myFunction after you define it');" ], "type": "waypoint",