Fix: remove try-catch in util.js
This commit is contained in:
		
							parent
							
								
									23bd3e2cc7
								
							
						
					
					
						commit
						a1b8945996
					
				| 
						 | 
					@ -55,6 +55,7 @@ function dirtyReporter() {
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  function onChange(cb) {
 | 
					  function onChange(cb) {
 | 
				
			||||||
 | 
					    // make sure the callback doesn't throw
 | 
				
			||||||
    onchanges.push(cb);
 | 
					    onchanges.push(cb);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -67,11 +68,7 @@ function dirtyReporter() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  function emitChange() {
 | 
					  function emitChange() {
 | 
				
			||||||
    for (const cb of onchanges) {
 | 
					    for (const cb of onchanges) {
 | 
				
			||||||
      try {
 | 
					 | 
				
			||||||
      cb();
 | 
					      cb();
 | 
				
			||||||
      } catch (e) {
 | 
					 | 
				
			||||||
        console.error(e);
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user