Work with modules that assign to exports
CommonJS style modules will either assign `exports` to `module` or will assign properties to `exports`. This allows us to work with either style:
module.exports = Foo;
or
exports.Foo = Foo;
Support for additional properties that are assigned to `exports` (or non-function values assigned to `module.exports`) will likely take additional typedef work in the wrapper.
This commit is contained in:
@@ -40,7 +40,8 @@ function wrapModule(mod, callback) {
|
||||
'/** @typedef {function(*)} */\n' +
|
||||
'ol.ext.' + mod.name + ';\n' +
|
||||
'(function() {\n' +
|
||||
'var module = {};\n' +
|
||||
'var exports = {};\n' +
|
||||
'var module = {exports: exports};\n' +
|
||||
'/**\n' +
|
||||
' * @fileoverview\n' +
|
||||
' * @suppress {accessControls, ambiguousFunctionDecl, ' +
|
||||
|
||||
Reference in New Issue
Block a user