Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: compiled/bindings/generator.cpp

Issue 29543756: Noissue - fix generation of a new instance creation of a class without subclass differentiator (Closed) Base URL: https://github.com/adblockplus/adblockpluscore.git
Patch Set: remove fromPointer when there is no subclass differentiator Created Sept. 19, 2017, 9:12 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiled/bindings/generator.cpp
diff --git a/compiled/bindings/generator.cpp b/compiled/bindings/generator.cpp
index ab6c504625e3f21b96ae6d44ee7336c7dc307722..f375ff4903e8707b2fe9c21298d34fdc6d5ab858 100644
--- a/compiled/bindings/generator.cpp
+++ b/compiled/bindings/generator.cpp
@@ -259,7 +259,7 @@ namespace bindings_internal
auto offset = cls->subclass_differentiator.offset;
if (offset == SIZE_MAX)
- result += " result = exports." + cls->name + "(result);\n";
+ result += " result = new exports." + cls->name + "(result);\n";
else
result += " result = exports." + cls->name + ".fromPointer(result);\n";
@@ -449,13 +449,6 @@ namespace bindings_internal
printf(" throw new Error('Unexpected %s type: ' + type);\n", cls.name.c_str());
puts("};");
}
- else
- {
- printf("exports.%s.fromPointer = function(ptr)\n", cls.name.c_str());
- puts("{");
- printf(" return new exports.%s(ptr);\n", cls.name.c_str());
- puts("};");
- }
Wladimir Palant 2017/09/19 09:56:30 Having this method here for consistency won't real
for (const auto& method : cls.methods)
{
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld