Skip to content

this.query no longer has hasOwnProperty method in node 6.2 #747

@rickharrison

Description

@rickharrison

My code uses hasOwnProperty to check for certain properties on this.query. In node 6.2, it no longer has this method (or as it seems with the following test case, no other methods). Here is a failing test case for this issue (this test is intended to be in /test/request/query.js):

it('should return an object with hasOwnProperty', function (){
  var ctx = context({ url: '/?page=2' });
  ctx.query.should.have.property('hasOwnProperty');
})
1 failing

  1) ctx.query should return an object with hasOwnProperty:
     TypeError: Cannot read property 'have' of undefined
      at Context.<anonymous> (test/request/query.js:29:21)

This test passes on node v5.6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions