Sha256: 15696097c9f5c23fe5b409de46c8da4cf51a5e653b961e12a0ad3711a35cc69a

Contents?: true

Size: 526 Bytes

Versions: 4

Compression:

Stored size: 526 Bytes

Contents

/*
 * JsCatcher.cpp
 *
 *  Created on: Dec 23, 2014
 *      Author: sergeych
 */

#include "js_catcher.h"

namespace h8 {


JsCatcher::JsCatcher(H8* h8) : h8(h8), v8::TryCatch(h8->getIsolate()) {}

void JsCatcher::throwIfCaught() {
	if( HasCaught() ) {
		if( h8->isInterrupted() ) {
			puts("INTERRUPTED!");
			throw JsError(h8, "interrupted");
		}
		if( !CanContinue() && HasTerminated() ) {
//		if( HasTerminated() ) {
			throw JsTimeoutError(h8);
		}
		throw JsError(h8, Message(), Exception());
	}
}

} /* namespace h8 */

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
h8-0.2.5 ext/h8/js_catcher.cpp
h8-0.2.4 ext/h8/js_catcher.cpp
h8-0.2.3 ext/h8/js_catcher.cpp
h8-0.2.2 ext/h8/js_catcher.cpp