{"action":"created","issue":{"url":"https://api.github.com/repos/mooz/js2-mode/issues/243","labels_url":"https://api.github.com/repos/mooz/js2-mode/issues/243/labels{/name}","comments_url":"https://api.github.com/repos/mooz/js2-mode/issues/243/comments","events_url":"https://api.github.com/repos/mooz/js2-mode/issues/243/events","html_url":"https://github.com/mooz/js2-mode/issues/243","id":88997711,"number":243,"title":"V8 natives syntax","user":{"login":"eush77","id":4472489,"avatar_url":"https://avatars.githubusercontent.com/u/4472489?v=3","gravatar_id":"","url":"https://api.github.com/users/eush77","html_url":"https://github.com/eush77","followers_url":"https://api.github.com/users/eush77/followers","following_url":"https://api.github.com/users/eush77/following{/other_user}","gists_url":"https://api.github.com/users/eush77/gists{/gist_id}","starred_url":"https://api.github.com/users/eush77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eush77/subscriptions","organizations_url":"https://api.github.com/users/eush77/orgs","repos_url":"https://api.github.com/users/eush77/repos","events_url":"https://api.github.com/users/eush77/events{/privacy}","received_events_url":"https://api.github.com/users/eush77/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-17T12:00:36Z","updated_at":"2015-06-17T12:21:14Z","closed_at":null,"body":"V8 engine (and hence the Node) can provide access to its internal C++ runtime functions if `--allow-natives-syntax` flag is set (or configured at runtime with [thlorenz/v8-flags](https://github.com/thlorenz/v8-flags)).\r\n\r\nExample from [Optimization killers](https://github.com/petkaantonov/bluebird/wiki/Optimization-killers):\r\n\r\n```js\r\n//Function that contains the pattern to be inspected (using with statement)\r\nfunction containsWith() {\r\n    return 3;\r\n    with({}) {}\r\n}\r\n\r\nfunction printStatus(fn) {\r\n    switch(%GetOptimizationStatus(fn)) {\r\n        case 1: console.log(\"Function is optimized\"); break;\r\n        case 2: console.log(\"Function is not optimized\"); break;\r\n        case 3: console.log(\"Function is always optimized\"); break;\r\n        case 4: console.log(\"Function is never optimized\"); break;\r\n        case 6: console.log(\"Function is maybe deoptimized\"); break;\r\n    }\r\n}\r\n\r\n//Fill type-info\r\ncontainsWith();\r\n// 2 calls are needed to go from uninitialized -> pre-monomorphic -> monomorphic\r\ncontainsWith();\r\n\r\n%OptimizeFunctionOnNextCall(containsWith);\r\n//The next call\r\ncontainsWith();\r\n\r\n//Check\r\nprintStatus(containsWith);\r\n```\r\n\r\nAny chance this extension could fit into `js2-mode` and not cause syntax errors?"},"comment":{"url":"https://api.github.com/repos/mooz/js2-mode/issues/comments/112779760","html_url":"https://github.com/mooz/js2-mode/issues/243#issuecomment-112779760","issue_url":"https://api.github.com/repos/mooz/js2-mode/issues/243","id":112779760,"user":{"login":"dgutov","id":271877,"avatar_url":"https://avatars.githubusercontent.com/u/271877?v=3","gravatar_id":"","url":"https://api.github.com/users/dgutov","html_url":"https://github.com/dgutov","followers_url":"https://api.github.com/users/dgutov/followers","following_url":"https://api.github.com/users/dgutov/following{/other_user}","gists_url":"https://api.github.com/users/dgutov/gists{/gist_id}","starred_url":"https://api.github.com/users/dgutov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgutov/subscriptions","organizations_url":"https://api.github.com/users/dgutov/orgs","repos_url":"https://api.github.com/users/dgutov/repos","events_url":"https://api.github.com/users/dgutov/events{/privacy}","received_events_url":"https://api.github.com/users/dgutov/received_events","type":"User","site_admin":false},"created_at":"2015-06-17T12:21:14Z","updated_at":"2015-06-17T12:21:14Z","body":"What is required exactly? Supporting percent sign in front of function names?"}}