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' +
|
'/** @typedef {function(*)} */\n' +
|
||||||
'ol.ext.' + mod.name + ';\n' +
|
'ol.ext.' + mod.name + ';\n' +
|
||||||
'(function() {\n' +
|
'(function() {\n' +
|
||||||
'var module = {};\n' +
|
'var exports = {};\n' +
|
||||||
|
'var module = {exports: exports};\n' +
|
||||||
'/**\n' +
|
'/**\n' +
|
||||||
' * @fileoverview\n' +
|
' * @fileoverview\n' +
|
||||||
' * @suppress {accessControls, ambiguousFunctionDecl, ' +
|
' * @suppress {accessControls, ambiguousFunctionDecl, ' +
|
||||||
|
|||||||
Reference in New Issue
Block a user