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