Skip to content

Commit

Permalink
Allow null/undefined this context
Browse files Browse the repository at this point in the history
In some module resolving environments, `this` can be null. In this case, jsonic crashes the build process. This change resolves that issue.
Just for reference: senecajs/seneca#436 should be fixed with this change
  • Loading branch information
Max Nowack authored Dec 10, 2018
1 parent d50a48c commit bad6ee3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jsonic-head.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ TODO: if number fails, assume it's just a string, might be an identifier of some
*/

;(function() {
var root = this
var root = this || {}
var previous_jsonic = root.jsonic

var has_require = typeof require !== 'undefined'
Expand Down

0 comments on commit bad6ee3

Please sign in to comment.