Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbc77038

Browse files
author
John Haley
committed
Fixed callbacks to be null unless set in structs
1 parent2b0ee55 commitbc77038

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

‎generate/templates/partials/field_accessors.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343

4444
{% elsif field.isCallbackFunction %}
4545
if (value->IsFunction()) {
46+
if (!wrapper->raw->{{ field.name }}) {
47+
wrapper->raw->{{ field.name }} = ({{ field.cType }}){{ field.name }}_cppCallback;
48+
}
49+
4650
wrapper->{{ field.name }} =newNanCallback(value.As<Function>());
4751
}
4852

‎generate/templates/templates/struct_content.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void {{ cppClassName }}::ConstructFields() {
6363

6464
// Set the static method call and set the payload for this function to be
6565
// the current instance
66-
this->raw->{{ field.name }} =({{ field.cType }}){{ field.name }}_cppCallback;
66+
this->raw->{{ field.name }} =NULL;
6767
this->raw->{{ fields|payloadFor field.name }} = (void *)this;
6868
this->{{ field.name }} =newNanCallback();
6969
{% elsif field.payloadFor %}

‎test/tests/diff.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ describe("Diff", function() {
8585
assert.equal(lines[4].contentLen(),162);
8686
});
8787

88-
it.only("can diff the workdir with index",function(){
88+
it("can diff the workdir with index",function(){
8989
varpatches=this.workdirDiff.patches();
9090
assert.equal(patches.length,1);
9191
assert(patches[0].isUntracked());

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp