Ad
  • Custom User Avatar
  • Custom User Avatar

    I will update the throw information to say to throw the string. Thanks for pointing that out.

  • Custom User Avatar

    Hmmm... I try logging some data during the before, the primary, and the after methods. If you are calling the after methods before the primary method, then you would fail these tests. I'll copy the tests to the demo test.

    That might also be the first test where you need to know that new Platypus() should also match lowercase object.

  • Custom User Avatar

    Thank you.... corrected that.

  • Custom User Avatar

    Indeed, you are correct, that using an Array of prototype objects where I used a comma-separated string makes more sense. I also felt it made some parts of the problem more difficult without adding commensurate benefits.

    You can't check whether the string Rhino is more specific than the string Mammal. What you can check is that for a given object, if you go back through its __proto__ chain, you come across a constructor name Rhino before you come across a constructor name Mammal. It does limit what you can do about nicely storing partial methods because you can't know that if you already matched the string Rhino you don't have to bother matching the string Mammal. I suppose if I get a big hunk of time before anyone completes the kata, I might do as you suggest and convert the comma-separated string to an array of prototypes.