Vladislav Folts 11 년 전
부모
커밋
a41458a677
13개의 변경된 파일18개의 추가작업 그리고 30개의 파일을 삭제
  1. 0 4
      src/assert.js
  2. 0 0
      src/ob/String.ob
  3. 0 0
      src/ob/TestString.ob
  4. 1 1
      src/parser.js
  5. 2 3
      src/rtl.js
  6. 2 3
      test/expected/assert.js
  7. 2 3
      test/expected/chr.js
  8. 2 3
      test/expected/len.js
  9. 2 3
      test/expected/odd.js
  10. 2 3
      test/expected/ord.js
  11. 2 3
      test/expected/parentheses.js
  12. 2 3
      test/expected/string.js
  13. 1 1
      test/test_unit.js

+ 0 - 4
src/assert.js

@@ -1,4 +0,0 @@
-exports.ok = function(condition){
-	if (!condition)
-		throw new Error("assertion failed");
-}

+ 0 - 0
src/ob/String.ob


+ 0 - 0
src/ob/TestString.ob


+ 1 - 1
src/parser.js

@@ -1,6 +1,6 @@
 "use strict";
 
-var assert = require("assert.js").ok;
+var assert = require("rtl.js").assert;
 var Errors = require("js/Errors.js");
 var Lexer = require("js/Lexer.js");
 var Stream = require("js/Stream.js");

+ 2 - 3
src/rtl.js

@@ -160,10 +160,9 @@ var impl = {
             }
         }
     },
-    assert: function(condition, code){
+    assert: function(condition){
         if (!condition)
-            throw new Error("assertion failed"
-                          + ((code !== undefined) ? " with code " + code : ""));
+            throw new Error("assertion failed");
     }
 };
 

+ 2 - 3
test/expected/assert.js

@@ -1,8 +1,7 @@
 var RTL$ = {
-    assert: function (condition, code){
+    assert: function (condition){
         if (!condition)
-            throw new Error("assertion failed"
-                          + ((code !== undefined) ? " with code " + code : ""));
+            throw new Error("assertion failed");
     }
 };
 var m = function (){

+ 2 - 3
test/expected/chr.js

@@ -1,8 +1,7 @@
 var RTL$ = {
-    assert: function (condition, code){
+    assert: function (condition){
         if (!condition)
-            throw new Error("assertion failed"
-                          + ((code !== undefined) ? " with code " + code : ""));
+            throw new Error("assertion failed");
     }
 };
 var m = function (){

+ 2 - 3
test/expected/len.js

@@ -48,10 +48,9 @@ var RTL$ = {
         forward.push(makeCharArray.bind(undefined, length));
         return makeArray.apply(undefined, forward);
     },
-    assert: function (condition, code){
+    assert: function (condition){
         if (!condition)
-            throw new Error("assertion failed"
-                          + ((code !== undefined) ? " with code " + code : ""));
+            throw new Error("assertion failed");
     }
 };
 var m = function (){

+ 2 - 3
test/expected/odd.js

@@ -1,8 +1,7 @@
 var RTL$ = {
-    assert: function (condition, code){
+    assert: function (condition){
         if (!condition)
-            throw new Error("assertion failed"
-                          + ((code !== undefined) ? " with code " + code : ""));
+            throw new Error("assertion failed");
     }
 };
 var m = function (){

+ 2 - 3
test/expected/ord.js

@@ -1,8 +1,7 @@
 var RTL$ = {
-    assert: function (condition, code){
+    assert: function (condition){
         if (!condition)
-            throw new Error("assertion failed"
-                          + ((code !== undefined) ? " with code " + code : ""));
+            throw new Error("assertion failed");
     }
 };
 var m = function (){

+ 2 - 3
test/expected/parentheses.js

@@ -17,10 +17,9 @@ var RTL$ = {
                 result[i] = this.makeArray.apply(this, forward);
         return result;
     },
-    assert: function (condition, code){
+    assert: function (condition){
         if (!condition)
-            throw new Error("assertion failed"
-                          + ((code !== undefined) ? " with code " + code : ""));
+            throw new Error("assertion failed");
     }
 };
 var m = function (){

+ 2 - 3
test/expected/string.js

@@ -37,10 +37,9 @@ var RTL$ = {
         for(i = s.length; i < a.length; ++i)
             a[i] = 0;
     },
-    assert: function (condition, code){
+    assert: function (condition){
         if (!condition)
-            throw new Error("assertion failed"
-                          + ((code !== undefined) ? " with code " + code : ""));
+            throw new Error("assertion failed");
     },
     strCmp: function (s1, s2){
         var cmp = 0;

+ 1 - 1
test/test_unit.js

@@ -1,6 +1,6 @@
 "use strict";
 
-var assert = require("assert.js").ok;
+var assert = require("rtl.js").assert;
 var Class = require("rtl.js").Class;
 var Context = require("context.js");
 var Grammar = require("grammar.js");