You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/04/28 19:20:56 UTC

[GitHub] [cordova-js] raphinesse opened a new pull request #196: Fix adopted CommonJS test `hasOwnProperty`

raphinesse opened a new pull request #196: Fix adopted CommonJS test `hasOwnProperty`
URL: https://github.com/apache/cordova-js/pull/196
 
 
   ### Motivation and Context
   <!-- Why is this change required? What problem does it solve? -->
   <!-- If it fixes an open issue, please link to the issue here. -->
   One of the CommonJS tests in #195 exposed a defect in Cordova's module system:
   
   When trying to define a module with a name that also is a property of `Object.prototype`, an exception would occur.
   
   ### Description
   <!-- Describe your changes in detail -->
   Use `Object.prototype.hasOwnProperty.call(modules, id)` to check if a module has already been defined, instead of the previously used `modules[id]`.
   
   
   ### Testing
   <!-- Please describe in detail how you tested your changes. -->
   The changes make the previously failing test pass.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org