Sha256: fc9d622c70346e1ebafd9206e5b0b22c1536092f2c4ba3b266874e539d1b9b73

Contents?: true

Size: 762 Bytes

Versions: 11

Compression:

Stored size: 762 Bytes

Contents

// breakable.js
// MIT licensed, see LICENSE file
// Copyright (c) 2013-2014 Olov Lassus <olov.lassus@gmail.com>

var breakable = (function() {
    "use strict";

    function Val(val, brk) {
        this.val = val;
        this.brk = brk;
    }

    function make_brk() {
        return function brk(val) {
            throw new Val(val, brk);
        };
    }

    function breakable(fn) {
        var brk = make_brk();
        try {
            return fn(brk);
        } catch (e) {
            if (e instanceof Val && e.brk === brk) {
                return e.val;
            }
            throw e;
        }
    }

    return breakable;
})();

if (typeof module !== "undefined" && typeof module.exports !== "undefined") {
    module.exports = breakable;
}

Version data entries

11 entries across 11 versions & 4 rubygems

Version Path
ilog-0.4.1 node_modules/breakable/breakable.js
ilog-0.4.0 node_modules/breakable/breakable.js
ilog-0.3.3 node_modules/breakable/breakable.js
xcodebuild-helper-1.2.5 externals/ios-sim-master/node_modules/breakable/breakable.js
xcodebuild-helper-1.2.3 externals/ios-sim-master/node_modules/breakable/breakable.js
es6_tilt-0.1.2 test/dummy/app/assets/javascripts/node_modules/breakable/breakable.js
es6_tilt-0.1.1 test/dummy/app/assets/javascripts/node_modules/breakable/breakable.js
es6_tilt-0.1.0 test/dummy/app/assets/javascripts/node_modules/breakable/breakable.js
gulp_assets-1.0.0.pre.5 template/node_modules/babel-core/node_modules/regenerator/node_modules/defs/node_modules/breakable/breakable.js
gulp_assets-1.0.0.pre.4 template/node_modules/babel-core/node_modules/regenerator/node_modules/defs/node_modules/breakable/breakable.js
gulp_assets-1.0.0.pre.3 template/node_modules/babel-core/node_modules/regenerator/node_modules/defs/node_modules/breakable/breakable.js