Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update assertUtil.js #302

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions test/assertUtil.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
(function (window) {

if (typeof module != 'undefined') {
var assert = require('assert');
var util = require('util');
let assert = require('assert');
let util = require('util');
} else {
var assert = window.assert;
let assert = window.assert;
}

function ok(test, message) {
Expand All @@ -19,12 +19,12 @@
return typeof o == 'object';
}

var _DEFAULT_RANGE = 1e-6;
let _DEFAULT_RANGE = 1e-6;

var _DEBUG = 0;
let _DEBUG = 0;

function f(v1, v2, v3) {
var args = arguments || [v1, v2, v3];
let args = arguments || [v1, v2, v3];
if (typeof util !== 'undefined') {
return util.format.apply(util, args);
} else {
Expand All @@ -36,7 +36,7 @@
}
}

var lib = {
let lib = {

/**
* A "Constant function" -- returns the default threshold, so you can see but not alter it.
Expand Down Expand Up @@ -129,7 +129,7 @@
// Inline Definition of Number.IsNaN()
ok(!(typeof a === 'number' && a !== a), 'bad number a: ' + comment);
ok(!(typeof b === 'number' && b !== b), 'bad number b: ' + comment);
var dd = Math.abs(a - b);
let dd = Math.abs(a - b);
if (_DEBUG) console.log('dim: %s, dd: %s, threshold: %s ', dim, dd, threshold);
ok(dd <= threshold, comment);
}
Expand All @@ -140,4 +140,4 @@
} else {
module.exports = lib;
}
})(this);
})(this);