confess icon indicating copy to clipboard operation
confess copied to clipboard

TypeError: undefined is not an object (evaluating 'phantom.args.length')

Open hotbaby opened this issue 7 years ago • 1 comments

hotbaby avatar Jul 04 '17 00:07 hotbaby

diff --git a/confess.js b/confess.js
index 6164d55..99ea04d 100644
--- a/confess.js
+++ b/confess.js
@@ -1,3 +1,4 @@
+var system = require('system');
 var fs = require('fs');
 var confess = {
 
@@ -411,11 +412,11 @@ var confess = {
     },
 
     processArgs: function (config, contract) {
-        var a = 0;
+        var a = 1;
         var ok = true;
         contract.forEach(function(argument) {
-            if (a < phantom.args.length) {
-                config[argument.name] = phantom.args[a];
+            if (a < system.args.length) {
+                config[argument.name] = system.args[a];
             } else {
                 if (argument.req) {
                     console.log('"' + argument.name + '" argument is required. This ' + argument.desc + '.');

hotbaby avatar Jul 04 '17 01:07 hotbaby