Created
May 23, 2010 23:12
-
-
Save bmizerany/411338 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Handle<String> data; | |
RequestParser() : EventEmitter() { | |
data = String::New(""); | |
} | |
static Handle<Value> | |
Parse(const v8::Arguments& args) { | |
RequestParser *parser = ObjectWrap::Unwrap<RequestParser>(args.This()); | |
HandleScope scope; | |
if (args.Length() == 0 || !args[0]->IsString()) { | |
return ThrowException( | |
Exception::Error(String::New("Must give data string as argument")) | |
); | |
} | |
data = String::Concat(data, args[0]->ToString()); | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment