Skip to content

Make emscripten_run_script_string return C NULL on null/undefined - #8793

Merged
quantum5 merged 3 commits into
emscripten-core:incomingfrom
quantum5:run-script-string-null
Jun 18, 2019
Merged

quantum5 merged 3 commits into
emscripten-core:incomingfrom
quantum5:run-script-string-null

Conversation

@quantum5

Copy link
Copy Markdown
Member

Fixes #7291.

@quantum5
quantum5 requested review from aheejin, kripken and tlively June 13, 2019 20:00
Comment thread src/library.js
if (s == null) {
return null;
}
s += '';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The function should return an integer pointer to a C string on the wasm heap, so returning 0 instead of null would be better? The return value will be coerced from null to 0 anyways.

@quantum5
quantum5 merged commit a2d89ad into emscripten-core:incoming Jun 18, 2019
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.

emscripten_run_script_string returns "null" instead of (char*)0 for null strings.

3 participants