Web Inspector: Adopt ES6 Class Syntax for all Model Objects
https://bugs.webkit.org/show_bug.cgi?id=142858
Reviewed by Timothy Hatcher.
Source/WebInspectorUI:
- Convert WebInspector.Object to a class
- Convert all UserInterface/Models objects to classes
- Convert constructor functions to constructor methods
- Convert "constructor.method" to class static methods where possible
- Convert all methods to method syntax, eliminate commas between methods
- Convert all superclass calls in classes to use "super"
- Workaround <https://webkit.org/b/142862> and add empty constructors
- Added "deprecated" prefix to addConstructorFunctions, since it is not needed with classes
- Added many missing calls to super in constructors
- Added FIXME to WebInspector.Object subclasses not yet moved to classes.
- Cleaned up SourceMap global properties, moved to constructor instead of prototype
- Cleaned up Timeline factory constructor to static "create" factory method
- Fixed any style issues noticed in the mass edit
- Fixed strict mode issues now that classes enforce strict mode
- RunLoopTimelineRecord.js was missing a `var` for a local variable
- "const" is not allowed, converted to "var"
- "arguments.callee" is not allowed in strict mode
* UserInterface/**/*.js:
Many files modified mostly mechanically.
LayoutTests:
* inspector/model/parse-script-syntax-tree.html:
This test was calling a constructor without "new". Class
syntax enforces "new" and threw an exception.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@181769 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebInspectorUI/UserInterface/Models/Revision.js b/Source/WebInspectorUI/UserInterface/Models/Revision.js
index 4cf2c4b..398491a 100644
--- a/Source/WebInspectorUI/UserInterface/Models/Revision.js
+++ b/Source/WebInspectorUI/UserInterface/Models/Revision.js
@@ -23,33 +23,31 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-WebInspector.Revision = function()
+WebInspector.Revision = class Revision extends WebInspector.Object
{
- WebInspector.Object.call(this);
-};
-
-WebInspector.Revision.prototype = {
- constructor: WebInspector.Revision,
+ constructor()
+ {
+ // FIXME: Remove once <https://webkit.org/b/142862> is fixed.
+ super();
+ }
// Public
- apply: function()
+ apply()
{
// Implemented by subclasses.
console.error("Needs to be implemented by a subclass.");
- },
+ }
- revert: function()
+ revert()
{
// Implemented by subclasses.
console.error("Needs to be implemented by a subclass.");
- },
+ }
- copy: function()
+ copy()
{
// Override by subclasses.
return this;
}
};
-
-WebInspector.Revision.prototype.__proto__ = WebInspector.Object.prototype;