Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adapt to current node.js assertion API

  • Loading branch information...
commit a1058d8e5a3b2aa276df9701bcd917ed2b117d42 1 parent ab7056c
@hanshuebner hanshuebner authored
Showing with 11 additions and 11 deletions.
  1. +8 −8 lisp.js
  2. +3 −3 swank-handler.js
View
16 lisp.js
@@ -27,7 +27,7 @@
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
var util = require("util");
-var assert = process.assert;
+var assert = require("assert");
var I = {};
@@ -309,7 +309,7 @@ function naturalValue (v) {
};
function plistValue (l, useNatural, map) {
- assert(!map || !useNatural);
+ assert.ok(!map || !useNatural);
var origList = l;
var result = {};
for (; l !== nil; l = cdr(cdr(l))) {
@@ -327,7 +327,7 @@ function plistValue (l, useNatural, map) {
continue;
var mapSpec = map[targetName];
if (typeof(mapSpec) == "object") {
- assert(mapSpec.spec);
+ assert.ok(mapSpec.spec);
result[mapSpec.hasOwnProperty("name") ? mapSpec.name : targetName] =
fromLisp(value, mapSpec.spec);
} else {
@@ -353,11 +353,11 @@ function plainList (l, spec) {
var type = arg[0];
var name = arg[1];
if (type == ">") {
- assert(i < spec.length - 1);
+ assert.ok(i < spec.length - 1);
type = spec[++i];
}
if (type == ">*") {
- assert(i < spec.length - 1);
+ assert.ok(i < spec.length - 1);
result[name] = fromLisp(l, spec[++i]);
l = nil;
break;
@@ -473,7 +473,7 @@ function mappedPlistValueToLisp (o, map) {
continue;
var mapSpec = map[k];
if (typeof(mapSpec) == "object") {
- assert(mapSpec.spec);
+ assert.ok(mapSpec.spec);
items.push({ jsName: mapSpec.hasOwnProperty("name") ? mapSpec.name : k,
lispName: k, spec: mapSpec.spec });
} else {
@@ -521,13 +521,13 @@ function plainListToLisp (o, spec) {
var v = o[name];
if (type == ">") {
- assert(i < spec.length - 1);
+ assert.ok(i < spec.length - 1);
type = spec[++i];
}
switch (type) {
case ">*":
- assert(i < spec.length - 1);
+ assert.ok(i < spec.length - 1);
return append(reverse(r), toLisp(v, spec[++i]));
case "R":
return append(reverse(r), naturalValueToLisp(v));
View
6 swank-handler.js
@@ -31,7 +31,7 @@ var Script = process.binding('evals').Script;
var evalcx = Script.runInContext;
var util = require("util");
var url = require("url");
-var assert = process.assert;
+var assert = require("assert");
var lisp = require("./lisp");
var S = lisp.S, list = lisp.list, consp = lisp.consp, car = lisp.car, cdr = lisp.cdr,
repr = lisp.repr, fromLisp = lisp.fromLisp, toLisp = lisp.toLisp;
@@ -275,7 +275,7 @@ DefaultRemote.prototype.evaluate = function evaluate (id, str) {
// TBD: rename Executive to Dispatcher
function Executive (options) {
options = options || {};
- assert(options.hasOwnProperty("config") && options.config);
+ assert.ok(options.hasOwnProperty("config") && options.config);
this.config = options.config;
this.pid = options.hasOwnProperty("pid") ? options.pid : null;
this.remotes = [];
@@ -291,7 +291,7 @@ Executive.nextId = 1; // request id counter is global in order to avoid inter-co
Executive.nextRemoteIndex = 1;
Executive.prototype.attachRemote = function attachRemote (remote) {
- assert(this.remotes.indexOf(remote) < 0);
+ assert.ok(this.remotes.indexOf(remote) < 0);
remote.setIndex(Executive.nextRemoteIndex++);
var self = this;
Please sign in to comment.
Something went wrong with that request. Please try again.