{"action":"created","issue":{"url":"https://api.github.com/repos/ceylon/ceylon/issues/5874","repository_url":"https://api.github.com/repos/ceylon/ceylon","labels_url":"https://api.github.com/repos/ceylon/ceylon/issues/5874/labels{/name}","comments_url":"https://api.github.com/repos/ceylon/ceylon/issues/5874/comments","events_url":"https://api.github.com/repos/ceylon/ceylon/issues/5874/events","html_url":"https://github.com/ceylon/ceylon/issues/5874","id":124661030,"number":5874,"title":"Unicode character matching broken in JavaScript","user":{"login":"haumacher","id":5607145,"avatar_url":"https://avatars.githubusercontent.com/u/5607145?v=3","gravatar_id":"","url":"https://api.github.com/users/haumacher","html_url":"https://github.com/haumacher","followers_url":"https://api.github.com/users/haumacher/followers","following_url":"https://api.github.com/users/haumacher/following{/other_user}","gists_url":"https://api.github.com/users/haumacher/gists{/gist_id}","starred_url":"https://api.github.com/users/haumacher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haumacher/subscriptions","organizations_url":"https://api.github.com/users/haumacher/orgs","repos_url":"https://api.github.com/users/haumacher/repos","events_url":"https://api.github.com/users/haumacher/events{/privacy}","received_events_url":"https://api.github.com/users/haumacher/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ceylon/ceylon/labels/m-compiler-js","name":"m-compiler-js","color":"00aa00"},{"url":"https://api.github.com/repos/ceylon/ceylon/labels/t-bug","name":"t-bug","color":"e10c02"}],"state":"closed","locked":false,"assignee":{"login":"chochos","id":17679,"avatar_url":"https://avatars.githubusercontent.com/u/17679?v=3","gravatar_id":"","url":"https://api.github.com/users/chochos","html_url":"https://github.com/chochos","followers_url":"https://api.github.com/users/chochos/followers","following_url":"https://api.github.com/users/chochos/following{/other_user}","gists_url":"https://api.github.com/users/chochos/gists{/gist_id}","starred_url":"https://api.github.com/users/chochos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chochos/subscriptions","organizations_url":"https://api.github.com/users/chochos/orgs","repos_url":"https://api.github.com/users/chochos/repos","events_url":"https://api.github.com/users/chochos/events{/privacy}","received_events_url":"https://api.github.com/users/chochos/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/ceylon/ceylon/milestones/15","html_url":"https://github.com/ceylon/ceylon/milestones/1.2.3","labels_url":"https://api.github.com/repos/ceylon/ceylon/milestones/15/labels","id":1590811,"number":15,"title":"1.2.3","description":"","creator":{"login":"FroMage","id":179265,"avatar_url":"https://avatars.githubusercontent.com/u/179265?v=3","gravatar_id":"","url":"https://api.github.com/users/FroMage","html_url":"https://github.com/FroMage","followers_url":"https://api.github.com/users/FroMage/followers","following_url":"https://api.github.com/users/FroMage/following{/other_user}","gists_url":"https://api.github.com/users/FroMage/gists{/gist_id}","starred_url":"https://api.github.com/users/FroMage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FroMage/subscriptions","organizations_url":"https://api.github.com/users/FroMage/orgs","repos_url":"https://api.github.com/users/FroMage/repos","events_url":"https://api.github.com/users/FroMage/events{/privacy}","received_events_url":"https://api.github.com/users/FroMage/received_events","type":"User","site_admin":false},"open_issues":143,"closed_issues":135,"state":"open","created_at":"2016-02-18T14:05:01Z","updated_at":"2016-05-24T19:33:45Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-01-03T17:42:12Z","updated_at":"2016-05-24T19:33:45Z","closed_at":"2016-05-24T19:33:45Z","body":"Matching unicode characters works fine when compiling to JVM:\r\n```\r\nshared void run() {\r\n    String s1 = \"abc\\{MIDDLE DOT}def\";\r\n    \r\n    StringBuilder buffer = StringBuilder();\r\n    \r\n    s1.each(void (Character ch) {\r\n        switch (ch)\r\n        case ('a') {\r\n            buffer.append(\"[\");\r\n        }\r\n        case ('f') {\r\n            buffer.append(\"]\");\r\n        }\r\n        case ('\\{MIDDLE DOT}') {\r\n            buffer.append(\"[.]\");\r\n        }\r\n        else {\r\n            buffer.appendCharacter(ch);\r\n        }\r\n    });\r\n    \r\n    print(buffer.string);\r\n    assert (buffer.string == \"[bc[.]de]\");\r\n}\r\n```\r\n\r\nThe code above should print `[bc[.]de]`. However, when executing in the JavaScript runtime, the code prints `[bcï¿½de]` and fails:\r\n```\r\nC:\\local\\tools\\eclipse-jee-mars-R-win32-x86_64\\eclipse\\plugins\\com.redhat.ceylon.dist.repo_1.2.0.v20151028-2216\\repo\\ceylon\\language\\1.2.0\\ceylon.language-1.2.0.js:263\r\nif (!cond)throw wrapexc(AssertionError(msg),loc,file);\r\n          ^\r\n\r\nError: Assertion failed: 'buffer.string == \"[bc[.]de]\"' at run.ceylon (24:11-24:40)\r\n    at AssertionError (C:\\local\\tools\\eclipse-jee-mars-R-win32-x86_64\\eclipse\\plugins\\com.redhat.ceylon.dist.repo_1.2.0.v20151028-2216\\repo\\ceylon\\language\\1.2.0\\ceylon.language-1.2.0.js:3705:6)\r\n    at Object.asrt$ (C:\\local\\tools\\eclipse-jee-mars-R-win32-x86_64\\eclipse\\plugins\\com.redhat.ceylon.dist.repo_1.2.0.v20151028-2216\\repo\\ceylon\\language\\1.2.0\\ceylon.language-1.2.0.js:263:25)\r\n    at run (C:\\local\\devel\\webmath\\ceylon-demo\\modules\\unicode\\1.0.0\\unicode-1.0.0.js:33:8)\r\n    at [eval]:1:283\r\n    at Object.exports.runInThisContext (vm.js:54:17)\r\n    at Object.<anonymous> ([eval]-wrapper:6:22)\r\n    at Module._compile (module.js:425:26)\r\n    at node.js:589:27\r\n    at doNTCallback0 (node.js:430:9)\r\n    at process._tickCallback (node.js:359:13)\r\nceylon run-js: Node process exited with non-zero exit code: 1\r\n```\r\n\r\nIt seems that the match expression `case ('\\{MIDDLE DOT}')` does not work in the JavaScript runtime."},"comment":{"url":"https://api.github.com/repos/ceylon/ceylon/issues/comments/221378370","html_url":"https://github.com/ceylon/ceylon/issues/5874#issuecomment-221378370","issue_url":"https://api.github.com/repos/ceylon/ceylon/issues/5874","id":221378370,"user":{"login":"chochos","id":17679,"avatar_url":"https://avatars.githubusercontent.com/u/17679?v=3","gravatar_id":"","url":"https://api.github.com/users/chochos","html_url":"https://github.com/chochos","followers_url":"https://api.github.com/users/chochos/followers","following_url":"https://api.github.com/users/chochos/following{/other_user}","gists_url":"https://api.github.com/users/chochos/gists{/gist_id}","starred_url":"https://api.github.com/users/chochos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chochos/subscriptions","organizations_url":"https://api.github.com/users/chochos/orgs","repos_url":"https://api.github.com/users/chochos/repos","events_url":"https://api.github.com/users/chochos/events{/privacy}","received_events_url":"https://api.github.com/users/chochos/received_events","type":"User","site_admin":false},"created_at":"2016-05-24T19:33:45Z","updated_at":"2016-05-24T19:33:45Z","body":"This was fixed when we changed the way unicode chars are output."}}
{"actor":{"display_login":"chochos"}}