Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

missing enum generation for the v8 glue

  • Loading branch information...
commit cdae5c09abf5405627a5669c4a65f7b3e6fb04cc 1 parent 7f643f8
krizsa authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 tools/codequery/v8gen.js
View
10 tools/codequery/v8gen.js
@@ -152,7 +152,7 @@ function generate(file, classes) {
class = classes[c];
out.push(genFunctions(class.classname, class.properties),
genExtTraitTable(class.classname, class.properties),
- genInit(class.classname, class.base, class.properties)
+ genInit(class.classname, class.base, class.properties, class.enums)
);
}
@@ -160,7 +160,7 @@ function generate(file, classes) {
fs.writeFileSync(file.name.replace('.h','_glue.h'), out.join(''));
}
-function genInit(className, baseClass, properties) {
+function genInit(className, baseClass, properties, enums) {
function setMethod(className, propName) {
var ret = [];
ret.push(' target->Set(v8::String::NewSymbol("',propName,'"),\n\
@@ -197,6 +197,12 @@ function genInit(className, baseClass, properties) {
}
}
+ if (enums)
+ for (var i=0; i<enums.length; i++) {
+ ret.push(' target->Set(v8::String::NewSymbol("',enums[i].name,'"),\n\
+ v8::Integer::New(',enums[i].value,'));\n');
+ }
+
ret.push('}\n\n');
return ret.join('');
}
Please sign in to comment.
Something went wrong with that request. Please try again.