Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update js_iterator.ml #1217

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

davesnx
Copy link
Member

@davesnx davesnx commented Nov 15, 2024

Since records with underscore at the last position gets ommited, there's no reason to add mel.as, but also mel.as was placed in the wrong field.

Checking the playground found everything works as expected https://melange.re/unstable/playground/?language=OCaml&code=bW9kdWxlIERvbV9ibG9iID0gc3RydWN0CiAgKCogaHR0cHM6Ly9kZXZlbG9wZXIubW96aWxsYS5vcmcvZW4tVVMvZG9jcy9XZWIvQVBJL0Jsb2IvQmxvYiAqKQogIHR5cGUgdAoKICBleHRlcm5hbCBtYWtlIDogc3RyaW5nIEpzLkl0ZXJhdG9yLnQgLT4gdCA9ICJCbG9iIiBbQEBtZWwubmV3XQoKICBleHRlcm5hbCBhcnJheUJ1ZmZlciA6IHQgLT4gSnMuVHlwZWRfYXJyYXkuQXJyYXlCdWZmZXIudCBKcy5Qcm9taXNlLnQKICAgID0gImFycmF5QnVmZmVyIgoKICBleHRlcm5hbCBzaXplIDogdCAtPiBmbG9hdCA9ICJzaXplIiBbQEBtZWwuZ2V0XQoKICBleHRlcm5hbCBzbGljZSA6ID9zdGFydDppbnQgLT4gP2VuZF86aW50IC0%2BID9jb250ZW50VHlwZTpzdHJpbmcgLT4gdCA9ICJzbGljZSIKICBbQEBtZWwuc2VuZC5waXBlOiB0XQoKICBleHRlcm5hbCB0ZXh0IDogdCAtPiBzdHJpbmcgSnMuUHJvbWlzZS50ID0gInRleHQiIFtAQG1lbC5zZW5kXQogIGV4dGVybmFsIHR5cGVfIDogdCAtPiBzdHJpbmcgPSAidHlwZSIgW0BAbWVsLmdldF0KCiAgKCogc3RyZWFtIGNhbid0IGJlIGJpbmRlZCB1bnRpbCB3ZSBoYXZlIHNvbWUgYmluZGluZ3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2ZpbGUudCAtPiA%2FZmlsZW5hbWU6c3RyaW5nIC0%2BIHVuaXQKICA9ICJzZXQiCltAQG1lbC5zZW5kLnBpcGU6IHRdCgpleHRlcm5hbCBlbnRyaWVzIDogdCAtPiAoc3RyaW5nICogZW50cnlWYWx1ZSkgSnMuSXRlcmF0b3IudCA9ICJlbnRyaWVzIgpbQEBtZWwuc2VuZF0KCmxldCAoKSA9CiAgbGV0IGYgPSBtYWtlICgpIGluCiAgbGV0ICgpID0gc2V0IH5uYW1lOiJhZ2UiIH52YWx1ZToiMzMiIGYgaW4KICBsZXQgaXRlcmF0b3IgPSBKcy5BcnJheS52YWx1ZXMgW3wgIjEiOyAiMiI7ICIzIiB8XSBpbgoKICAoKiBNYW51YWwgaXRlcmF0aW9uIHVzaW5nIG5leHQoKSAqKQogIGxldCByZWMgcHJvY2Vzc19pdGVyYXRvciBpdGVyID0KICAgIGxldCByZXN1bHQgPSBKcy5JdGVyYXRvci5uZXh0IGl0ZXIgaW4KICAgIG1hdGNoIHJlc3VsdC52YWx1ZSB3aXRoCiAgICB8IFNvbWUgdiAtPgogICAgICAgIFByaW50Zi5wcmludGYgIlZhbHVlOiAlc1xuIiB2OwogICAgICAgIGlmIHJlc3VsdC5kb25lXyA8PiBTb21lIHRydWUgdGhlbiBwcm9jZXNzX2l0ZXJhdG9yIGl0ZXIKICAgIHwgTm9uZSAtPiAoKQogIGluCgogIGxldCAoKSA9IHByb2Nlc3NfaXRlcmF0b3IgaXRlcmF0b3IgaW4KCiAgbGV0IGJsb2IgPSBEb21fYmxvYi5tYWtlIGl0ZXJhdG9yIGluCiAgbGV0ICgpID0gc2V0QmxvYiB%2BbmFtZToiYWdlIiB%2BdmFsdWU6YmxvYiBmIGluCiAgKCogbGV0IGFnZSA9IGdldCB%2BbmFtZToiYWdlIiBmIGluICopCiAgSnMubG9nIGYK&live=off

Since records with underscore at the last position gets ommited, there's no reason to add mel.as, but also mel.as was placed in the wrong field.

Checking the playground found everything works as expected https://melange.re/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lOiJhZ2UiIH52YWx1ZToiMzMiIGYgaW4KICBsZXQgaXRlcmF0b3IgPSBKcy5BcnJheS52YWx1ZXMgW3wgIjEiOyAiMiI7ICIzIiB8XSBpbgoKICAoKiBNYW51YWwgaXRlcmF0aW9uIHVzaW5nIG5leHQoKSAqKQogIGxldCByZWMgcHJvY2Vzc19pdGVyYXRvciBpdGVyID0KICAgIGxldCByZXN1bHQgPSBKcy5JdGVyYXRvci5uZXh0IGl0ZXIgaW4KICAgIG1hdGNoIHJlc3VsdC52YWx1ZSB3aXRoCiAgICB8IFNvbWUgdiAtPgogICAgICAgIFByaW50Zi5wcmludGYgIlZhbHVlOiAlc1xuIiB2OwogICAgICAgIGlmIHJlc3VsdC5kb25lXyA8PiBTb21lIHRydWUgdGhlbiBwcm9jZXNzX2l0ZXJhdG9yIGl0ZXIKICAgIHwgTm9uZSAtPiAoKQogIGluCgogIGxldCAoKSA9IHByb2Nlc3NfaXRlcmF0b3IgaXRlcmF0b3IgaW4KCiAgbGV0IGJsb2IgPSBEb21fYmxvYi5tYWtlIGl0ZXJhdG9yIGluCiAgbGV0ICgpID0gc2V0QmxvYiB%2BbmFtZToiYWdlIiB%2BdmFsdWU6YmxvYiBmIGluCiAgKCogbGV0IGFnZSA9IGdldCB%2BbmFtZToiYWdlIiBmIGluICopCiAgSnMubG9nIGYK&live=off
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.

1 participant