Skip to content

Instantly share code, notes, and snippets.

@cha0s
Created July 12, 2012 21:48
Show Gist options
  • Save cha0s/3101307 to your computer and use it in GitHub Desktop.
Save cha0s/3101307 to your computer and use it in GitHub Desktop.
// if (customValue = newCustomValue type)?
// V: [customvalue]
// else
// values = vicarValues entity, type
// I: [values[Object.keys(values)[0]].index]
Handle<Object> argument = Object::New();
Handle<v8::Value> customValue = newCustomValue(type);
if (!customValue->IsUndefined()) {
Handle<Array> a = Array::New();
a->Set(0, customValue);
argument->Set(String::New("V"), a);
}
else {
ValueMap vicarValues = this->vicarValues(entity, type);
Handle<Array> a = Array::New();
a->Set(
0,
String::New(vicarValues[vicarValues.keys()[0]].index.toAscii())
);
argument->Set(String::New("I"), a);
}
return argument;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment