Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

make app.raise() public

  • Loading branch information...
commit 19fe20dadabe5be2442c8eb981c1477e96e82859 1 parent 308a919
Eldar Gabdullin authored September 08, 2012

Showing 2 changed files with 11 additions and 6 deletions. Show diff stats Hide diff stats

  1. 9  lib/app.js
  2. 8  lib/box.js
9  lib/app.js
@@ -109,7 +109,12 @@ App.prototype.onerror = function (path, fn) {
109 109
   return this
110 110
 }
111 111
 
112  
-App.prototype._raise = function (p, e) {
  112
+App.prototype.raise = function (path, e) {
  113
+  if (arguments.length == 1) {
  114
+    e = path
  115
+    path = '&'
  116
+  }
  117
+  var p = this._resolve(path)
113 118
   var handler, parent = p, self = this
114 119
 
115 120
   do {
@@ -124,7 +129,7 @@ App.prototype._raise = function (p, e) {
124 129
   function raise (err) {
125 130
     if (err == null) return
126 131
     if (p == parent) throw err
127  
-    self._raise(parent, err)
  132
+    self.raise(parent, err)
128 133
   }
129 134
 
130 135
   try {
8  lib/box.js
@@ -161,7 +161,7 @@ Execute.prototype.eval = function (cb) {
161 161
       fn.call(proxy, get, function (error, val) {
162 162
         if (error) {
163 163
           cb(error)
164  
-          self.app._raise(self.box.path, error)
  164
+          self.app.raise(self.box.path, error)
165 165
           return
166 166
         }
167 167
         self.promise.val = val
@@ -170,7 +170,7 @@ Execute.prototype.eval = function (cb) {
170 170
     }
171 171
   } catch (e) {
172 172
     cb(e)
173  
-    this.app._raise(this.box.path, e)
  173
+    this.app.raise(this.box.path, e)
174 174
   }
175 175
 }
176 176
 
@@ -203,7 +203,7 @@ ExecuteAfter.prototype.eval = function (cb) {
203 203
       fn.call(proxy, get, this.promise.val, function (error, val) {
204 204
         if (error) {
205 205
           cb(error)
206  
-          self.app._raise(self.box.path, error)
  206
+          self.app.raise(self.box.path, error)
207 207
           return
208 208
         }
209 209
         if (val !== undefined) self.promise.val = val
@@ -212,7 +212,7 @@ ExecuteAfter.prototype.eval = function (cb) {
212 212
     }
213 213
   } catch (e) {
214 214
     cb(e)
215  
-    this.app._raise(this.box.path, e)
  215
+    this.app.raise(this.box.path, e)
216 216
   }
217 217
 }
218 218
 

0 notes on commit 19fe20d

Please sign in to comment.
Something went wrong with that request. Please try again.