Skip to content
This repository was archived by the owner on Aug 23, 2019. It is now read-only.
This repository was archived by the owner on Aug 23, 2019. It is now read-only.

exports is not defined when running instanceOf in browser #8

@bendecoste

Description

@bendecoste
ReferenceError: exports is not defined
    at formatValue (http://localhost:5050/node_modules/goinstant-assert/index.js:502:25)
    at inspect (http://localhost:5050/node_modules/goinstant-assert/index.js:465:10)
    at objectDisplay (http://localhost:5050/node_modules/goinstant-assert/index.js:437:13)
    at new AssertionError (http://localhost:5050/node_modules/goinstant-assert/index.js:21:32)
    at fancyFail (http://localhost:5050/node_modules/goinstant-assert/index.js:72:9)
    at Function.assert.instanceOf (http://localhost:5050/node_modules/goinstant-assert/index.js:250:5)
function formatValue(ctx, value, recurseTimes) {
  // Provide a hook for user-specified inspect functions.
  // Check that value is an object with an inspect function on it
  if (value && typeof value.inspect === 'function' &&
      // Filter out the util module, it's inspect function is special
      value.inspect !== exports.inspect &&
      // Also filter out any prototype objects using the circular check.
      !(value.constructor && value.constructor.prototype === value)) {
    var ret = value.inspect(recurseTimes);
    if (typeof ret !== 'string') {
      ret = formatValue(ctx, ret, recurseTimes);
    }
    return ret;
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions