Skip to content

Commit e86fdda

Browse files
Updated JavaScript test files.
1 parent b8b7c38 commit e86fdda

File tree

10 files changed

+89
-6
lines changed

10 files changed

+89
-6
lines changed

ClearScriptTest/JavaScript/CommonJS/Arithmetic/Arithmetic.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license.
33

4-
// ReSharper disable once PossiblyUnassignedProperty
54
exports.Meta = module.getContext();
65

76
exports.Add = function (a, b) {

ClearScriptTest/JavaScript/CommonJS/Geometry/Geometry.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
let Arithmetic = require("../Arithmetic/Arithmetic");
55
let Self = require("Geometry");
66

7-
// ReSharper disable once PossiblyUnassignedProperty
87
exports.Meta = module.getContext();
98

109
exports.Rectangle = class {

ClearScriptTest/JavaScript/CommonJS/Geometry/GeometryWithPathlessImport.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
let Arithmetic = require("Arithmetic");
55
let Self = require("Geometry");
66

7-
// ReSharper disable once PossiblyUnassignedProperty
87
exports.Meta = module.getContext();
98

109
exports.Rectangle = class {
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license.
33

4-
// ReSharper disable once JsPathNotFound
5-
let Geometry = require("Geometry/Geometry.js");
4+
let Geometry = require("Geometry/Geometry");
65

76
// ReSharper disable once ReturnFromGlobalScopetWithValue
87
return new Geometry.Square(25).Area;

ClearScriptTest/JavaScript/CommonJS/ModuleWithSideEffects.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license.
33

4-
// ReSharper disable once JsPathNotFound
54
let Geometry = require("Geometry/Geometry");
65

76
foo.bar = new Geometry.Square(25).Area;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT license.
3+
4+
exports.Meta = module.getContext();
5+
6+
exports.Add = function (a, b) {
7+
return a + b;
8+
}
9+
10+
exports.Subtract = function (a, b) {
11+
return a - b;
12+
}
13+
14+
exports.Multiply = function (a, b) {
15+
return a * b;
16+
}
17+
18+
exports.Divide = function (a, b) {
19+
return a / b;
20+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT license.
3+
4+
var Arithmetic = require("../Arithmetic/Arithmetic");
5+
var Self = require("Geometry");
6+
7+
exports.Meta = module.getContext();
8+
9+
exports.Rectangle = function(width, height) {
10+
this.width = width;
11+
this.height = height;
12+
}
13+
14+
exports.Rectangle.prototype.getArea = function() {
15+
return Self.Rectangle.CalculateArea(this.width, this.height);
16+
};
17+
18+
exports.Rectangle.CalculateArea = function(width, height) {
19+
return Arithmetic.Multiply(width, height);
20+
};
21+
22+
exports.Square = function(side) {
23+
exports.Rectangle.call(this, side, side);
24+
};
25+
26+
exports.Square.prototype.getArea = exports.Rectangle.prototype.getArea;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT license.
3+
4+
var Arithmetic = require("Arithmetic");
5+
var Self = require("Geometry");
6+
7+
exports.Meta = module.getContext();
8+
9+
exports.Rectangle = function (width, height) {
10+
this.width = width;
11+
this.height = height;
12+
}
13+
14+
exports.Rectangle.prototype.getArea = function () {
15+
return Self.Rectangle.CalculateArea(this.width, this.height);
16+
};
17+
18+
exports.Rectangle.CalculateArea = function (width, height) {
19+
return Arithmetic.Multiply(width, height);
20+
};
21+
22+
exports.Square = function (side) {
23+
exports.Rectangle.call(this, side, side);
24+
};
25+
26+
exports.Square.prototype.getArea = exports.Rectangle.prototype.getArea;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT license.
3+
4+
let Geometry = require("Geometry/Geometry");
5+
6+
// ReSharper disable once ReturnFromGlobalScopetWithValue
7+
return new Geometry.Square(25).Area;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT license.
3+
4+
let Geometry = require("Geometry/Geometry");
5+
6+
foo.bar = new Geometry.Square(25).Area;
7+
8+
// ReSharper disable once ReturnFromGlobalScopetWithValue
9+
return foo.bar;

0 commit comments

Comments
 (0)