{"action":"created","issue":{"url":"https://api.github.com/repos/pug-php/pug/issues/206","repository_url":"https://api.github.com/repos/pug-php/pug","labels_url":"https://api.github.com/repos/pug-php/pug/issues/206/labels{/name}","comments_url":"https://api.github.com/repos/pug-php/pug/issues/206/comments","events_url":"https://api.github.com/repos/pug-php/pug/issues/206/events","html_url":"https://github.com/pug-php/pug/issues/206","id":372569719,"node_id":"MDU6SXNzdWUzNzI1Njk3MTk=","number":206,"title":"Undefined variable: Math on line 0, offset 0","user":{"login":"radiocity","id":2347073,"node_id":"MDQ6VXNlcjIzNDcwNzM=","avatar_url":"https://avatars0.githubusercontent.com/u/2347073?v=4","gravatar_id":"","url":"https://api.github.com/users/radiocity","html_url":"https://github.com/radiocity","followers_url":"https://api.github.com/users/radiocity/followers","following_url":"https://api.github.com/users/radiocity/following{/other_user}","gists_url":"https://api.github.com/users/radiocity/gists{/gist_id}","starred_url":"https://api.github.com/users/radiocity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radiocity/subscriptions","organizations_url":"https://api.github.com/users/radiocity/orgs","repos_url":"https://api.github.com/users/radiocity/repos","events_url":"https://api.github.com/users/radiocity/events{/privacy}","received_events_url":"https://api.github.com/users/radiocity/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-22T15:29:15Z","updated_at":"2018-10-22T18:30:05Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\nI encountered an issue with the following code:\r\n```pug\r\nmixin mymixin\r\n  - var random = Math.round(Math.random() * (35535 - 10) + 10)\r\n  h1 #{random}\r\n+mymixin\r\n```\r\n```php\r\n$pug = new Pug([\r\n  'cache' => false,\r\n  'extension' => '.pug',\r\n  'basedir' => DIR_PUG,\r\n  'expressionLanguage' => 'js'\r\n]);\r\necho $pug->renderFile('test');\r\n```\r\n\r\nI expected to get:\r\n```\r\n<h1>random number here</h1>\r\n```\r\n\r\nBut I actually get:\r\n```\r\nErrorException in mymixin:\r\nUndefined variable: Math on line 0, offset 0\r\n```\r\nI couldnt use nodejs due to hosting restriction. Is it possible to enable Math functions?\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/pug-php/pug/issues/comments/431926613","html_url":"https://github.com/pug-php/pug/issues/206#issuecomment-431926613","issue_url":"https://api.github.com/repos/pug-php/pug/issues/206","id":431926613,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMTkyNjYxMw==","user":{"login":"kylekatarnls","id":5966783,"node_id":"MDQ6VXNlcjU5NjY3ODM=","avatar_url":"https://avatars1.githubusercontent.com/u/5966783?v=4","gravatar_id":"","url":"https://api.github.com/users/kylekatarnls","html_url":"https://github.com/kylekatarnls","followers_url":"https://api.github.com/users/kylekatarnls/followers","following_url":"https://api.github.com/users/kylekatarnls/following{/other_user}","gists_url":"https://api.github.com/users/kylekatarnls/gists{/gist_id}","starred_url":"https://api.github.com/users/kylekatarnls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kylekatarnls/subscriptions","organizations_url":"https://api.github.com/users/kylekatarnls/orgs","repos_url":"https://api.github.com/users/kylekatarnls/repos","events_url":"https://api.github.com/users/kylekatarnls/events{/privacy}","received_events_url":"https://api.github.com/users/kylekatarnls/received_events","type":"User","site_admin":false},"created_at":"2018-10-22T18:30:05Z","updated_at":"2018-10-22T18:30:05Z","author_association":"MEMBER","body":"expressionLanguage `js` provide JS syntax but not JS engine, simply use PHP equivalent functions:\r\n\r\n```pug\r\nmixin mymixin\r\n  - var random = mt_rand(10, 35535)\r\n  h1 #{random}\r\n+mymixin\r\n```"}}
{"actor":{"display_login":"kylekatarnls"}}