From 3e17668b4e75774d2963e44338bb0e0fdfe90884 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Mon, 17 Apr 2017 19:04:34 +0200 Subject: [PATCH] Don't mention ES6 classes, since they should *not* be used everywhere in the code base until https://bugzilla.mozilla.org/show_bug.cgi?id=1167472 is fixed; and use shorthand notation for methods as well as objects (https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Object_initializer#New_notations_in_ECMAScript_2015). --- Style-Guide.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Style-Guide.md b/Style-Guide.md index f875424..c2c1dce 100644 --- a/Style-Guide.md +++ b/Style-Guide.md @@ -45,7 +45,7 @@ if (someVar === conditionA) { Variables must be defined only once within a function scope, preferably at the top of the function. ## Classes -The transition towards ES6 classes has started, but until that is completed, the standard way of creating classes in PDF.js, when adding *new* code, is the following. Please note that by class we mean an object that is class-like. +The standard way of creating classes in PDF.js, when adding *new* code, is the following. Please note that by class we mean an object that is class-like. ```javascript var ClassName = (function ClassNameClosure() { @@ -54,13 +54,13 @@ var ClassName = (function ClassNameClosure() { } ClassName.prototype = { - functionName: function(arg1, arg2, ...) { + functionName(arg1, arg2, ...) { ... }, - aVeryVeryVeryLongFunctionName: function (arg1, - arg2, - ...) { + aVeryVeryVeryLongFunctionName(arg1, + arg2, + ...) { ... }, };