Sha256: 255af98da1da11dd6991e3e5a47a35227cecb19252084545683b29a93781b827

Contents?: true

Size: 1.17 KB

Versions: 479

Compression:

Stored size: 1.17 KB

Contents

/* -*- Mode: js; js-indent-level: 2; -*- */
/*
 * Copyright 2011 Mozilla Foundation and contributors
 * Licensed under the New BSD license. See LICENSE or:
 * http://opensource.org/licenses/BSD-3-Clause
 */
define('test/source-map/assert', ['exports'], function (exports) {

  let do_throw = function (msg) {
    throw new Error(msg);
  };

  exports.init = function (throw_fn) {
    do_throw = throw_fn;
  };

  exports.doesNotThrow = function (fn) {
    try {
      fn();
    }
    catch (e) {
      do_throw(e.message);
    }
  };

  exports.equal = function (actual, expected, msg) {
    msg = msg || String(actual) + ' != ' + String(expected);
    if (actual != expected) {
      do_throw(msg);
    }
  };

  exports.ok = function (val, msg) {
    msg = msg || String(val) + ' is falsey';
    if (!Boolean(val)) {
      do_throw(msg);
    }
  };

  exports.strictEqual = function (actual, expected, msg) {
    msg = msg || String(actual) + ' !== ' + String(expected);
    if (actual !== expected) {
      do_throw(msg);
    }
  };

  exports.throws = function (fn) {
    try {
      fn();
      do_throw('Expected an error to be thrown, but it wasn\'t.');
    }
    catch (e) {
    }
  };

});

Version data entries

479 entries across 234 versions & 33 rubygems

Version Path
spider-src-0.1.6 lib/spider-src/support/spider/node_modules/spider-script/node_modules/traceur/node_modules/regexpu/node_modules/recast/node_modules/source-map/build/assert-shim.js
spider-src-0.1.6 lib/spider-src/support/spider/node_modules/spider-script/node_modules/multi-stage-sourcemap/node_modules/source-map/build/assert-shim.js
spider-src-0.1.6 lib/spider-src/support/spider/node_modules/spider-script/node_modules/escodegen/node_modules/source-map/build/assert-shim.js
spider-src-0.1.6 lib/spider-src/support/spider/node_modules/spider-script/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/assert-shim.js
trans-0.5.10 template/node_modules/gulp-concat/node_modules/concat-with-sourcemaps/node_modules/source-map/build/assert-shim.js
trans-0.5.10 template/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/assert-shim.js
trans-0.5.10 template/node_modules/gulp-uglify/node_modules/uglify-js/node_modules/source-map/build/assert-shim.js
trans-0.5.9 template/node_modules/gulp-concat/node_modules/concat-with-sourcemaps/node_modules/source-map/build/assert-shim.js
trans-0.5.9 template/node_modules/grunt-contrib-uglify/node_modules/uglify-js/node_modules/source-map/build/assert-shim.js
trans-0.5.9 template/node_modules/gulp-uglify/node_modules/uglify-js/node_modules/source-map/build/assert-shim.js
pleeease-0.0.3 node_modules/pleeease/node_modules/postcss/node_modules/source-map/build/assert-shim.js
pleeease-0.0.3 node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/build/assert-shim.js
pleeease-0.0.2 node_modules/pleeease/node_modules/postcss/node_modules/source-map/build/assert-shim.js
pleeease-0.0.2 node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/build/assert-shim.js
sprockets-browserify-0.3.0 node_modules/browserify/node_modules/umd/node_modules/ruglify/node_modules/uglify-js/node_modules/source-map/build/assert-shim.js
sprockets-browserify-0.3.0 node_modules/browserify/node_modules/umd/node_modules/uglify-js/node_modules/source-map/build/assert-shim.js
sprockets-browserify-0.3.0 node_modules/browserify/node_modules/module-deps/node_modules/detective/node_modules/escodegen/node_modules/source-map/build/assert-shim.js
sprockets-browserify-0.3.0 node_modules/browserify/node_modules/browser-pack/node_modules/combine-source-map/node_modules/source-map/build/assert-shim.js
webruby-0.2.7 modules/emscripten/tools/node_modules/source-map/build/assert-shim.js
cssesc-source-0.1.0 vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/build/assert-shim.js