Loading ...
Sorry, an error occurred while loading the content.

2107Re: [jslint] Re: infix_in warnings

Expand Messages
  • John Hawkinson
    Apr 5 5:23 AM
      Again, I *want* to follow the inheritance chain,
      not to specifically disregard it:

      function object(o) { function F() {} F.prototype = o; return new F(); };
      var o1 = { alpha: 1 };
      var o2 = object(o1);
      ...
      if ('alpha' in o2) { ...


      Sorry if this language was unclear:
      > > Any thoughts on the appropriate workaround for infix_in warnings
      > > without using .hasOwnProperty() which doesn't follow the inheritance
      > > chain?


      > The in operator should have been the hasOwnProperty operator. hasOwnProperty
      > should have been an operator, not a method, because
      > being a method, it is prone to these sorts of problems. But it is
      > what it is, so you have to work around that.

      Am I on a fool's errand? Should I be throwing out the ability of objects
      to inherit and assume that any property inheritance is an error?
      I feel like that's not the right assumption?

      --jhawk@...
      John Hawkinson
    • Show all 6 messages in this topic