Skip to content

Asynchronous Module Definition returns undefined #199

Description

@esfoden

hi all, I love the BigInteger library, its fast and the BigInt polyfill mechanism is very useful.

Unfortunately it doesn't seem to work with AMD modules. Using require.js v 2.3.6:

requirejs(["./node_modules/big-integer/BigInteger"], function (big) {

the returned "big" variable is undefined. The problem seems to be at line 1450 of BigInteger.js:

define("big-integer", [], function () {

there are two problems here. Firstly it is the user of the module that names it (I named it "big" above) not the module itself and secondly "big-integer" is not a valid javascript identifier.

The solution is easy: change 1450 to:

define( function () {

and it all works beautifully. I thought I would post the issue here for verification and discussion before submitting a pull request.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions