Created
November 1, 2011 05:13
-
-
Save tolmasky/1329979 to your computer and use it in GitHub Desktop.
Building a Better JavaScript Profiler with WebKit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| document.addEventListener("click", function() { /*...*/ }, false); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| document.addEventListener("click", function clicked() { /*...*/ }, false); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function generator(/*Number*/ iterations) | |
| { | |
| return function() | |
| { | |
| for (var i = 0; i < iterations; ++i) | |
| // do something | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function generator(/*Number*/ iterations) | |
| { | |
| return function iterate() | |
| { | |
| for (var i = 0; i < iterations; ++i) | |
| // do something | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MyClass.method = function() | |
| { | |
| // MyClass class method | |
| } | |
| MyClass.prototype.method = function() | |
| { | |
| // MyClass instance method | |
| } | |
| MyOtherClass.prototype.method = function() | |
| { | |
| // MyOtherClass instance method | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MyClass.method = function $_MyClass__class__method() | |
| { | |
| // MyClass class method | |
| } | |
| MyClass.prototype.method = function $_MyClass__method() | |
| { | |
| // MyClass instance method | |
| } | |
| MyOtherClass.prototype.method = function $_MyOtherClass__method() | |
| { | |
| // MyOtherClass instance method | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function generator(/*Number*/ iterations) | |
| { | |
| var generated = function() | |
| { | |
| for (var i = 0; i < iterations; ++i) | |
| // do something | |
| } | |
| generated.displayName = "iterating " + iterations + " times"; | |
| return generated; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MyClass.method = function() | |
| { | |
| // MyClass class method | |
| } | |
| MyClass.method.displayName = "MyClass.method (class)"; | |
| MyClass.prototype.method = function() | |
| { | |
| // MyClass instance method | |
| } | |
| MyClass.prototype.method.displayName = "MyClass.method"; | |
| MyOtherClass.prototype.method = function() | |
| { | |
| // MyOtherClass instance method | |
| } | |
| MyOtherClass.prototype.method.displayName = "MyOtherClass.method"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment