Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Commit

Permalink
Use assert that is removed by minification. Resolves #112
Browse files Browse the repository at this point in the history
  • Loading branch information
inexorabletash committed Dec 15, 2016
1 parent 3bdeabb commit 7b3bafa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions es2016.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

// Helpers

function assert(c, m) {
if (!c) throw Error("Internal assertion failure" + (m ? ': ' + m : ''));
function isSymbol(s) {
return (typeof s === 'symbol') || ('Symbol' in global && s instanceof global.Symbol);
}

function define(o, p, v, override) {
Expand All @@ -20,7 +20,7 @@

if (typeof v === 'function') {
// Sanity check that functions are appropriately named (where possible)
assert((global.Symbol && p instanceof global.Symbol) || !('name' in v) || v.name === p || v.name === p + '_', 'Expected function name "' + p + '", was "' + v.name + '"');
console.assert(isSymbol(p) || !('name' in v) || v.name === p || v.name === p + '_', 'Expected function name "' + p.toString() + '", was "' + v.name + '"');
Object.defineProperty(o, p, {
value: v,
configurable: true,
Expand Down
6 changes: 3 additions & 3 deletions polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -4284,8 +4284,8 @@ function __cons(t, a) {

// Helpers

function assert(c, m) {
if (!c) throw Error("Internal assertion failure" + (m ? ': ' + m : ''));
function isSymbol(s) {
return (typeof s === 'symbol') || ('Symbol' in global && s instanceof global.Symbol);
}

function define(o, p, v, override) {
Expand All @@ -4294,7 +4294,7 @@ function __cons(t, a) {

if (typeof v === 'function') {
// Sanity check that functions are appropriately named (where possible)
assert((global.Symbol && p instanceof global.Symbol) || !('name' in v) || v.name === p || v.name === p + '_', 'Expected function name "' + p + '", was "' + v.name + '"');
console.assert(isSymbol(p) || !('name' in v) || v.name === p || v.name === p + '_', 'Expected function name "' + p.toString() + '", was "' + v.name + '"');
Object.defineProperty(o, p, {
value: v,
configurable: true,
Expand Down
Loading

0 comments on commit 7b3bafa

Please sign in to comment.