Ad
  • Custom User Avatar

    @jhoffner thanks for updating to /\n/g but yep I'm trying to forbid that too...

    Do you guys still having this issue?

  • Custom User Avatar

    Same error after disabling Docker. Any other advice?

    Really was looking forward to finishing this kata..

    EDIT: Never mind! Apparently I just had to wait a few minutes. :-)

  • Custom User Avatar

    Same thing happened to me, look at my comment right below yours for a possible solution.

  • Custom User Avatar

    Does this error occur if I'm using regex?

    /codewars/frameworks/javascript/cw-2.js:135
                return out.replace(new RegExp('\n', 'g'), '<:LF:>');
                                   ^
    TypeError: undefined is not a function
        at Object.Test.format (/codewars/frameworks/javascript/cw-2.js:135:32)
        at Object.Test.handleError (/codewars/frameworks/javascript/cw-2.js:237:48)
        at Object.Test.handleError (/codewars/frameworks/javascript/cw-2.js:227:26)
        at [eval]:3:6
        at Object. ([eval]-wrapper:6:22)
        at Module._compile (module.js:456:26)
        at evalScript (node.js:536:25)
        at startup (node.js:80:7)
        at node.js:906:3
    

    The funny thing is...I'm not using regex. Halp?

  • Custom User Avatar

    Good call, I had completely forgotten I had that on. Thanks!

  • Custom User Avatar

    Codewars is in the middle of rolling out the new Docker system to the user base and you are on the new system (or you have manually opted in via the account settings page). The updated framework uses RegExp internally which is why this is having issues. We are updating the code to use /\n/g instead to prevent this from happening.

    Notice BTW how easy it is to bypass the lack of RegExp being defined. Its a language feature and as such I don't think it is possible to fully disable regular expressions.

    EDIT: NM, I just noticed the Function toString hack to check for literal notation.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Hi,
    Do you still have the issue?
    I'm trying with the code you posted here but I don't have this error. I got: "Test Failed: Invalid chars count! - Expected: 17, instead got: 16" on the 9th test case.

    Maybe you didn't paste your whole code?
    Remember: Regex are not allowed!

    Tip: internally, RegExp has been setted to undefined like that :

    // Disallow RegExp
    RegExp = undefined;
    
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution