Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

console.assert() missing from code hints #3655

Closed
peterflynn opened this issue Apr 28, 2013 · 7 comments
Closed

console.assert() missing from code hints #3655

peterflynn opened this issue Apr 28, 2013 · 7 comments

Comments

@peterflynn
Copy link
Member

  1. Type 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.

@petetronic
Copy link
Contributor

The built-ins are from Tern.JS defs files, with console specifically defined in browser.json.
https://github.com/marijnh/tern/blob/master/defs/browser.json

These appear to be based on the Gecko (Mozilla) documentation, which does not list a console.assert() method.

@peterflynn
Copy link
Member Author

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?

@ghost ghost assigned peterflynn May 3, 2013
@njx
Copy link

njx commented May 3, 2013

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?

@petetronic
Copy link
Contributor

We can always try, doesn't seem unreasonable. I'll ask @dloverin to take a look.

@ghost ghost assigned dloverin May 14, 2013
@eztierney
Copy link
Contributor

What about the other console methods that are non-standard, but match between safari, chrome, and firebug? Methods like

console.dir
console.profile
console.group
etc

Do we want hints for all the common methods?

chrome: https://developers.google.com/chrome-developer-tools/docs/console-api#consoleassertexpression_object
firebug: http://getfirebug.com/wiki/index.php/Console_API
safari: https://developer.apple.com/library/safari/#documentation/AppleApplications/Conceptual/Safari_Developer_Guide/DebuggingYourWebsite/DebuggingYourWebsite.html (need to search for Console API, it's near the end)
ie: http://msdn.microsoft.com/en-us/library/ie/hh772183(v=vs.85).aspx

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.

@redmunds
Copy link
Contributor

Was assigned to tern team, so marking "Needs Review".

@dangoor dangoor self-assigned this Apr 1, 2014
@ficristo
Copy link
Collaborator

I see console.assert and console.group in the hints, but not console.profile.
I'd say this is fixed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants