Skip to content

Conversation

@mhmd-azeez
Copy link
Contributor

@mhmd-azeez mhmd-azeez force-pushed the fix/nullable-payloads branch from 5d74e5f to e6c669c Compare December 15, 2024 16:59
return getDefaultForType(property.xtpType!)
}

function getDefaultForType(type: XtpNormalizedType): string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm kind of confused what's happening here. why does it need a default type? javascript has nulls

<% if (imp.output) { -%>
const outputMemory = Memory.find(ptr);
if (isEmpty(outputMemory)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't it be the string "null" and not empty?

xtp plugin build --path $PLUGIN_NAME
echo "testing '$PLUGIN_NAME'..."
xtp plugin test $PLUGIN_NAME/dist/plugin.wasm --with test.wasm --mock-host mock.wasm
xtp plugin test $PLUGIN_NAME/dist/plugin.wasm --with test.wasm --mock-host mock.wasm --log-level debug
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea :)

@mhmd-azeez
Copy link
Contributor Author

@bhelx after reading your comments and thinking about it a bit more, i realized this all came up because of I had incorrectly implemented my host function to return 0 instead of null. You're right, I don't think this is necessary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants