Fix stack trace error in javascript challenge

- added a additional check to make sure the function exists
This commit is contained in:
Dieter Daems 2015-12-31 14:17:07 +01:00
parent 7e3be9adea
commit 1627faf2f0

View File

@ -1841,8 +1841,8 @@
],
"tests": [
"assert(typeof myFunction === 'function', 'message: <code>myFunction</code> should be a function');",
"capture(); myFunction(1,2); uncapture(); assert(logOutput == 3, 'message: <code>myFunction(1,2)</code> should output <code>3</code>');",
"capture(); myFunction(7,9); uncapture(); assert(logOutput == 16, 'message: <code>myFunction(7,9)</code> should output <code>16</code>');",
"if(typeof myFunction === \"function\") { capture(); myFunction(1,2); uncapture(); } assert(logOutput == 3, 'message: <code>myFunction(1,2)</code> should output <code>3</code>');",
"if(typeof myFunction === \"function\") { capture(); myFunction(7,9); uncapture(); } assert(logOutput == 16, 'message: <code>myFunction(7,9)</code> should output <code>16</code>');",
"assert(/^\\s*myFunction\\(\\s*\\d+\\s*,\\s*\\d+\\s*\\)\\s*;/m.test(code), 'message: Call <code>myFunction</code> after you define it');"
],
"type": "waypoint",