mirror of
https://github.com/RustyRaptor/brackets.git
synced 2026-12-04 00:15:22 -07:00
This also alters StringMatch.multiFieldSort to use an array to define the sort order,
though I stopped short of deprecating the old { key: priority } format.
147 lines
2.4 KiB
JavaScript
147 lines
2.4 KiB
JavaScript
/*jslint vars: true, plusplus: true, devel: true, browser: true, nomen: true, indent: 4, maxerr: 50 */
|
|
/*global brackets, require */
|
|
|
|
var A1 = { propA : 1 },
|
|
A2 = { propA : 2 },
|
|
A3 = A2;
|
|
|
|
function funB(paramB1, paramB2) {
|
|
'use strict';
|
|
|
|
var B1 = { propB : 1 },
|
|
B2 = { propB : 2 };
|
|
|
|
function funC(paramC1, paramC2) {
|
|
var C1 = { propC : 1 },
|
|
C2 = { propC : 2 };
|
|
|
|
B1.propB = 0;
|
|
C1.propC = 0;
|
|
B1.foo = 0;
|
|
console.log("hello\\\" world!");
|
|
}
|
|
|
|
var s = "a string";
|
|
var r = s;
|
|
var t = r;
|
|
|
|
}
|
|
|
|
/**
|
|
* @param {string} a
|
|
* @param {number} b
|
|
*/
|
|
function funD(a, b) {
|
|
"use strict";
|
|
return {x: a, y: b};
|
|
}
|
|
|
|
require(["MyModule"], function (myModule) {
|
|
'use strict';
|
|
var x = myModule.a;
|
|
});
|
|
|
|
funB();
|
|
var x = A1;
|
|
|
|
var arr = [];
|
|
arr["my-key"] = 1;
|
|
arr["for"] = 10;
|
|
|
|
function MClass() {
|
|
"use strict";
|
|
}
|
|
MClass.prototype.calc = function (a4, b4) {
|
|
"use strict";
|
|
return a4 + b4;
|
|
};
|
|
|
|
var ins1 = new MClass();
|
|
ins1.calc(10, 10);
|
|
|
|
var Person = function (name) {
|
|
"use strict";
|
|
this.name = name;
|
|
};
|
|
|
|
Person.prototype.getName = function () {
|
|
"use strict";
|
|
return this.name;
|
|
};
|
|
|
|
var Customer = function (name) {
|
|
"use strict";
|
|
this.name = name;
|
|
};
|
|
|
|
Customer.prototype = new Person();
|
|
|
|
var myCustomer = new Customer('Dream Inc.');
|
|
myCustomer.getName();
|
|
|
|
Customer.prototype.setAmountDue = function (amountDue) {
|
|
"use strict";
|
|
this.amountDue = amountDue;
|
|
};
|
|
Customer.prototype.getAmountDue = function () {
|
|
"use strict";
|
|
return this.amountDue;
|
|
};
|
|
|
|
function testInnerFunc() {
|
|
"use strict";
|
|
var t = "test";
|
|
function innerFunc(arg) {
|
|
return {t: function () {return arg; }};
|
|
}
|
|
var t2 = innerFunc("test").t().toLocaleLowerCase();
|
|
|
|
}
|
|
|
|
/**
|
|
* @param {boolean} a
|
|
* @param {Date} b
|
|
*/
|
|
|
|
function funTypeAn1(a, b) {
|
|
"use strict";
|
|
return {x: a, y: b};
|
|
}
|
|
|
|
/**
|
|
* @param {function(): number} f
|
|
*/
|
|
function funFuncArg(f) {
|
|
"use strict";
|
|
return f();
|
|
}
|
|
|
|
function testRef1() {
|
|
"use strict";
|
|
return 100;
|
|
}
|
|
|
|
funFuncArg(testRef1); //also test return type
|
|
|
|
/**
|
|
* @param {function(string,number): string} f
|
|
*/
|
|
function funFunc2Arg(f) {
|
|
"use strict";
|
|
var s = "test";
|
|
return f(s, 10);
|
|
}
|
|
|
|
function testRef2(s, n) {
|
|
"use strict";
|
|
return s + n;
|
|
}
|
|
|
|
funFunc2Arg(testRef2);
|
|
|
|
var funArr = [];
|
|
funArr.index1 = testRef1;
|
|
funArr.index2 = testRef2;
|
|
|
|
var _A1 = A1;
|