Link to a constructor function's prototype
See original GitHub issueWith the following code:
function Person(name) {
this.name = name;
}
Person.prototype.sayName = function() {
console.log(this.name);
}
var john = new Person('john');
john.sayName();
It would be nice if js-hyperclick could link the sayName
on the last line back to its definition.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:2
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Object.prototype.constructor - JavaScript - MDN Web Docs
The constructor data property of an Object instance returns a reference to the constructor function that created the instance object.
Read more >An Visual Guide to JavaScript Constructor / Prototype Pattern
Use JavaScript constructor/prototype to define a custom type in ES5. · Initialize the object properties in the constructor function and define methods and ......
Read more >5.4: Constructor Functions and Prototype Objects
A simple solution is to have Constructor Functions have a special property map associated with the function, and then have a link to...
Read more >Link Constructors prototypes to create Inheritance in JavaScript
A function returns a newly created object if it is called using the new, which is also known as Constructor Invocation Pattern. You...
Read more >How to link two constructors and inherit them as prototype to ...
Not yet :-) Your prototype objects are empty. ... create the sub-class constructor function Sample2(name, age) { // invokes superclass ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
http://ternjs.net/ seems to be trying to solve this problem. It’s complex enough to need to spin up a whole server for analysis that has a client in your editor.
If you’ll switch to writing Flow instead of standard JavaScript Nuclide has jump to definition support
Thanks, I’m using atom-ternjs@0.12.2 now, which has this feature working (v0.13 had a bug about it).