Ejemplo n.º 1
0
//bitset1.logicalor(bitset2,orbitset);
static JSVAL bs_logicalor(JSARGS args) {
    HandleScope scope;
    EWAHBoolArray<LENGTH>* bs = (EWAHBoolArray<LENGTH>*) External::Unwrap(args[0]);
    if (!bs) {
        return v8::ThrowException(v8::String::New("In logicalor bitset 1 is Null"));
    }
    EWAHBoolArray<LENGTH>* bs2 = (EWAHBoolArray<LENGTH>*) External::Unwrap(args[1]);
    if (!bs2) {
        return v8::ThrowException(v8::String::New("In logicalor bitset 2 is Null"));
    }
    EWAHBoolArray<LENGTH>* bs3 = (EWAHBoolArray<LENGTH>*) External::Unwrap(args[2]);
    if (!bs3) {
        return v8::ThrowException(v8::String::New("In logicalor bitset 3 is Null"));
    }
    
    try {
        bs->logicalor(*bs2, *bs3);
    } catch(std::out_of_range e) {
        return v8::ThrowException(v8::String::New("In logicalor std::out_of_range"));
    }
    
    return scope.Close(Null());
}