Skip to content

Commit 14440a9

Browse files
committed
Merge branch 'master' into polylinesOnTerrainCheckDuplicates
2 parents 042f1e4 + 6f66dbf commit 14440a9

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed

CONTRIBUTORS.md

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
4444
* [William Ho](https://github.com/williamkho)
4545
* [Srinivas Kaza](https://github.com/AnimatedRNG)
4646
* [Hannah Bollar](https://github.com/hanbollar)
47+
* [Jane Xu](https://github.com/janeyx99)
4748
* [Luke San Antonio Bialecki](https://github.com/lukesanantonio)
4849
* [Josh Lawrence](https://github.com/loshjawrence)
4950
* [Omar Shehata](https://github.com/OmarShehata)

Documentation/Contributors/CodingGuide/README.md

+17-2
Original file line numberDiff line numberDiff line change
@@ -507,10 +507,10 @@ Because result parameters aren't always required or returned, don't strictly rel
507507
```js
508508
Cartesian3.add(v0, v1, result);
509509
Cartesian3.add(result, v2, result);
510-
```
510+
```
511511
is better written as
512512
```js
513-
result = Cartesian3.add(v0, v1, result);
513+
result = Cartesian3.add(v0, v1, result);
514514
result = Cartesian3.add(result, v2, result);
515515
```
516516

@@ -544,6 +544,21 @@ var p = new Cartesian3(1.0, 2.0, 3.0);
544544
p.x = 'Cesium'; // Changes x to a string, slows down property access
545545
```
546546

547+
* In a constructor function, consider properties as write once; do not write to them or read them multiple times. Create a local variable if they need to be ready. For example:
548+
549+
Instead of
550+
```javascript
551+
this._x = 2;
552+
this._xSquared = this._x * this._x;
553+
```
554+
555+
prefer
556+
```javascript
557+
var x = 2;
558+
this._x = x;
559+
this._xSquared = x * x;
560+
```
561+
547562
### `from` Constructors
548563

549564
:art: Constructor functions should take the basic components of the class as parameters. For example, `Cartesian3` takes `x`, `y`, and `z`.

gulpfile.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var gulpRename = require('gulp-rename');
2424
var gulpReplace = require('gulp-replace');
2525
var Promise = require('bluebird');
2626
var requirejs = require('requirejs');
27-
var karma = require('karma').Server;
27+
var Karma = require('karma').Server;
2828
var yargs = require('yargs');
2929
var aws = require('aws-sdk');
3030
var mime = require('mime');
@@ -634,16 +634,16 @@ gulp.task('test', function(done) {
634634
files.push({pattern : 'Build/**', included : false});
635635
}
636636

637-
karma.start({
637+
var karma = new Karma({
638638
configFile: karmaConfigFile,
639-
browsers : browsers,
639+
browsers: browsers,
640640
specReporter: {
641641
suppressErrorSummary: false,
642642
suppressFailed: false,
643643
suppressPassed: suppressPassed,
644644
suppressSkipped: true
645645
},
646-
detectBrowsers : {
646+
detectBrowsers: {
647647
enabled: enableAllBrowsers
648648
},
649649
files: files,
@@ -653,6 +653,7 @@ gulp.task('test', function(done) {
653653
}, function(e) {
654654
return done(failTaskOnError ? e : undefined);
655655
});
656+
karma.start();
656657
});
657658

658659
gulp.task('generateStubs', ['build'], function(done) {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"gulp-zip": "^4.0.0",
5555
"jasmine-core": "^3.1.0",
5656
"jsdoc": "^3.4.3",
57-
"karma": "^2.0.0",
57+
"karma": "^2.0.3",
5858
"karma-chrome-launcher": "^2.0.0",
5959
"karma-detect-browsers": "^2.2.3",
6060
"karma-edge-launcher": "^0.4.2",

0 commit comments

Comments
 (0)