-
Notifications
You must be signed in to change notification settings - Fork 7.6k
console.assert() missing from code hints #3655
Comments
The built-ins are from Tern.JS defs files, with console specifically defined in browser.json. These appear to be based on the Gecko (Mozilla) documentation, which does not list a console.assert() method. |
Since console.assert() is defined in Chrome, Safari, and Firebug I wonder if it wouldn't be such a hard sell to get it added. Is there a general policy on how many browsers need to support something before it's added to Tern's default built-ins? |
Reviewed. To @peterflynn, low priority, adding "tracking" (not creating a "tern" label yet since it's not clear whether we'll have a lot of these). Peter--I wonder if we should consider just making a pull request directly to Marijn with the addition to the browser.json file? |
We can always try, doesn't seem unreasonable. I'll ask @dloverin to take a look. |
What about the other console methods that are non-standard, but match between safari, chrome, and firebug? Methods like console.dir Do we want hints for all the common methods? chrome: https://developers.google.com/chrome-developer-tools/docs/console-api#consoleassertexpression_object It looks like even ie10 adds 'assert'. Also, even if these aren't in tern, we can write .json files for whatever we want and load them into tern. It looks like they are additive, so we can just add the missing methods in, and we wouldn't have to duplicate the entire browser.json file. |
Was assigned to tern team, so marking "Needs Review". |
I see |
console.a
Result: "assert" is not listed in code hints
Expected: You get hints for console.log(), console.warn(), and console.error(), so assert() should be included too.
The text was updated successfully, but these errors were encountered: