Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 499665 | Differences between
and this patch

Collapse All | Expand All

(-)a/bundles/org.eclipse.orion.client.javascript/web/eslint/lib/load-rules-async.js (-41 / +175 lines)
Lines 2006-2053 define([ Link Here
2006
		},
2006
		},
2007
		/** @callback */
2007
		/** @callback */
2008
		"semi": function(context) {
2008
		"semi": function(context) {
2009
        		/**
2010
		         * @description Check the given node for a trailing semicolon
2011
		         * @param {Object} node The AST node
2012
		         */
2013
		        function checkForSemicolon(node) {
2014
    				var tokens = context.getTokens(node);
2015
    				var len = tokens.length;
2016
    				var t = tokens[len - 1];
2017
    				if (t && t.type === "Punctuator" && (t.value === ";" || t.value === '.')) {
2018
    					return;
2019
    				}
2020
    				context.report(node, ProblemMessages['semi'], null, t /* expose the bad token */);
2021
        		}
2022
        		/**
2023
		         * @description Check the variable decl node for trailing semicolon
2024
		         * @param {Object} node The AST node
2025
		         */
2026
		        function checkVariableDeclaration(node) {
2027
    				var ancestors = context.getAncestors(node),
2028
    				    parent = ancestors[ancestors.length - 1],
2029
    				    parentType = parent.type;
2030
    				if ((parentType === "ForStatement" && parent.init === node) || (parentType === "ForInStatement" && parent.left === node)
2031
    					|| parentType === "ForOfStatement" && parent.left === node) {
2032
    					// One of these cases, no semicolon token is required after the VariableDeclaration:
2033
    					// for(var x;;)
2034
    					// for(var x in y)
2035
    					// for(var x of n)
2036
    					return;
2037
    				}
2038
    				checkForSemicolon(node);
2039
        		}
2040
2009
2041
        		return {
2010
			var OPT_OUT_PATTERN = /[\[\(\/\+\-]/; // One of [(/+-
2042
        			"VariableDeclaration": checkVariableDeclaration,
2011
			var options = context.options[1];
2043
        			"ExpressionStatement": checkForSemicolon,
2012
			var never = context.options[0] === "never",
2044
        			"ReturnStatement": checkForSemicolon,
2013
				exceptOneLine = options && options.omitLastInOneLineBlock === true,
2045
        			"ThrowStatement": checkForSemicolon,
2014
				sourceCode = context.getSourceCode();
2046
        			"BreakStatement": checkForSemicolon,
2015
2047
        			"ContinueStatement": checkForSemicolon
2016
			//--------------------------------------------------------------------------
2048
        		};
2017
			// Helpers
2049
        },
2018
			//--------------------------------------------------------------------------
2050
        /** @callback */
2019
2020
			/**
2021
			 * Reports a semicolon error with appropriate location and message.
2022
			 * @param {ASTNode} node The node with an extra or missing semicolon.
2023
			 * @param {boolean} missing True if the semicolon is missing.
2024
			 * @returns {void}
2025
			 */
2026
			function report(node, missing) {
2027
				/*
2028
				if (!missing) {
2029
					var tokens = context.getTokens(node);
2030
					var len = tokens.length;
2031
					var t = tokens[len - 1];
2032
					if (t && t.type === "Punctuator" && (t.value === ";" || t.value === '.')) {
2033
						return;
2034
					}
2035
					context.report(node, ProblemMessages['semi'], null, t);
2036
				} else {
2037
					context.report(node, ProblemMessages['no-extra-semi']);
2038
				}*/
2039
	           var message,
2040
	                lastToken = sourceCode.getLastToken(node),
2041
	                ruleId = null;
2042
	
2043
	            if (!missing) {
2044
	                message = ProblemMessages["semi"];
2045
	            } else {
2046
	                message = ProblemMessages["no-extra-semi"];
2047
	                ruleId = "no-extra-semi";
2048
	            }
2049
	
2050
	            context.report({
2051
	                node: node,
2052
	                loc: lastToken.loc,
2053
	                message: message,
2054
	                ruleId: ruleId,
2055
	                data: lastToken
2056
	            });
2057
			}
2058
2059
			/**
2060
			 * Checks whether a token is a semicolon punctuator.
2061
			 * @param {Token} token The token.
2062
			 * @returns {boolean} True if token is a semicolon punctuator.
2063
			 */
2064
			function isSemicolon(token) {
2065
				return token.type === "Punctuator" && token.value === ";";
2066
			}
2067
2068
			/**
2069
			 * Check if a semicolon is unnecessary, only true if:
2070
			 *   - next token is on a new line and is not one of the opt-out tokens
2071
			 *   - next token is a valid statement divider
2072
			 * @param {Token} lastToken last token of current node.
2073
			 * @returns {boolean} whether the semicolon is unnecessary.
2074
			 */
2075
			function isUnnecessarySemicolon(lastToken) {
2076
				var isDivider, isOptOutToken, lastTokenLine, nextToken, nextTokenLine;
2077
2078
				if (!isSemicolon(lastToken)) {
2079
					return false;
2080
				}
2081
2082
				nextToken = sourceCode.getTokenAfter(lastToken);
2083
2084
				if (!nextToken) {
2085
					return true;
2086
				}
2087
2088
				lastTokenLine = lastToken.loc.end.line;
2089
				nextTokenLine = nextToken.loc.start.line;
2090
				isOptOutToken = OPT_OUT_PATTERN.test(nextToken.value);
2091
				isDivider = nextToken.value === "}" || nextToken.value === ";";
2092
2093
				return (lastTokenLine !== nextTokenLine && !isOptOutToken) || isDivider;
2094
			}
2095
2096
			/**
2097
			 * Checks a node to see if it's in a one-liner block statement.
2098
			 * @param {ASTNode} node The node to check.
2099
			 * @returns {boolean} whether the node is in a one-liner block statement.
2100
			 */
2101
			function isOneLinerBlock(node) {
2102
				var nextToken = sourceCode.getTokenAfter(node);
2103
2104
				if (!nextToken || nextToken.value !== "}") {
2105
					return false;
2106
				}
2107
2108
				var parent = node.parent;
2109
2110
				return parent && parent.type === "BlockStatement" &&
2111
					parent.loc.start.line === parent.loc.end.line;
2112
			}
2113
2114
			/**
2115
			 * Checks a node to see if it's followed by a semicolon.
2116
			 * @param {ASTNode} node The node to check.
2117
			 * @returns {void}
2118
			 */
2119
			function checkForSemicolon(node) {
2120
				var lastToken = sourceCode.getLastToken(node);
2121
2122
				if (never) {
2123
					if (isUnnecessarySemicolon(lastToken)) {
2124
						report(node, true);
2125
					}
2126
				} else {
2127
					if (!isSemicolon(lastToken)) {
2128
						if (!exceptOneLine || !isOneLinerBlock(node)) {
2129
							report(node);
2130
						}
2131
					} else {
2132
						if (exceptOneLine && isOneLinerBlock(node)) {
2133
							report(node, true);
2134
						}
2135
					}
2136
				}
2137
			}
2138
2139
			/**
2140
			 * Checks to see if there's a semicolon after a variable declaration.
2141
			 * @param {ASTNode} node The node to check.
2142
			 * @returns {void}
2143
			 */
2144
			function checkForSemicolonForVariableDeclaration(node) {
2145
				var ancestors = context.getAncestors(),
2146
					parentIndex = ancestors.length - 1,
2147
					parent = ancestors[parentIndex];
2148
2149
				if ((parent.type !== "ForStatement" || parent.init !== node) &&
2150
					(!/^For(?:In|Of)Statement/.test(parent.type) || parent.left !== node)
2151
				) {
2152
					checkForSemicolon(node);
2153
				}
2154
			}
2155
2156
			//--------------------------------------------------------------------------
2157
			// Public API
2158
			//--------------------------------------------------------------------------
2159
2160
			return {
2161
				VariableDeclaration: checkForSemicolonForVariableDeclaration,
2162
				ExpressionStatement: checkForSemicolon,
2163
				ReturnStatement: checkForSemicolon,
2164
				ThrowStatement: checkForSemicolon,
2165
				DoWhileStatement: checkForSemicolon,
2166
				DebuggerStatement: checkForSemicolon,
2167
				BreakStatement: checkForSemicolon,
2168
				ContinueStatement: checkForSemicolon,
2169
				ImportDeclaration: checkForSemicolon,
2170
				ExportAllDeclaration: checkForSemicolon,
2171
				ExportNamedDeclaration: function(node) {
2172
					if (!node.declaration) {
2173
						checkForSemicolon(node);
2174
					}
2175
				},
2176
				ExportDefaultDeclaration: function(node) {
2177
					if (!/(?:Class|Function)Declaration/.test(node.declaration.type)) {
2178
						checkForSemicolon(node);
2179
					}
2180
				}
2181
			};
2182
2183
		},
2184
		/** @callback */
2051
        "unknown-require": function(context) {
2185
        "unknown-require": function(context) {
2052
        	var directive;
2186
        	var directive;
2053
        	function checkDirective(node) {
2187
        	function checkDirective(node) {
(-)a/bundles/org.eclipse.orion.client.javascript/web/javascript/ruleData.js (-1 / +1 lines)
Lines 86-92 define([ Link Here
86
			"no-with" : 1,
86
			"no-with" : 1,
87
			"quotes" : [1, "double", {avoidEscape: false, allowTemplateLiterals: false}],
87
			"quotes" : [1, "double", {avoidEscape: false, allowTemplateLiterals: false}],
88
			"radix" : 1,
88
			"radix" : 1,
89
			"semi" : 1,
89
			"semi" : [1, "always", {omitLastInOneLineBlock: false}],
90
			"type-checked-consistent-return" : 0,
90
			"type-checked-consistent-return" : 0,
91
			"unnecessary-nls" : 0,
91
			"unnecessary-nls" : 0,
92
			"unknown-require": 1,
92
			"unknown-require": 1,
(-)a/bundles/org.eclipse.orion.client.javascript/web/eslint/lib/rule-context.js (-3 / +3 lines)
Lines 137-146 function RuleContext(ruleId, eslint, severity, options, settings, ecmaFeatures, Link Here
137
                fix = descriptor.fix(new RuleFixer());
137
                fix = descriptor.fix(new RuleFixer());
138
            }
138
            }
139
139
140
			var id = descriptor.ruleId ? descriptor.ruleId : ruleId;
140
            eslint.report(
141
            eslint.report(
141
                ruleId, severity, descriptor.node,
142
                id, severity, descriptor.node,
142
                descriptor.loc || descriptor.node.loc.start,
143
                descriptor.loc || descriptor.node.loc.start,
143
                descriptor.message, descriptor.data, fix
144
                descriptor.message, null, null, descriptor.data
144
            );
145
            );
145
146
146
            return;
147
            return;
Lines 170-173 RuleContext.prototype = { Link Here
170
171
171
 return RuleContext;
172
 return RuleContext;
172
});
173
});
173
(-)a/bundles/org.eclipse.orion.client.javascript/web/javascript/nls/root/messages.js (+4 lines)
Lines 68-73 define({ Link Here
68
	'noNewWrappersFixName': 'Remove \'new\' keyword',
68
	'noNewWrappersFixName': 'Remove \'new\' keyword',
69
	'noMixedSpacesAndTabs' : 'Mixed spaces and tabs:',
69
	'noMixedSpacesAndTabs' : 'Mixed spaces and tabs:',
70
	'missingSemi' : 'Missing semicolons:',
70
	'missingSemi' : 'Missing semicolons:',
71
	'missingSemiFineGrained' : 'Kinds:',
72
	'missingSemiOmitLastInOneLineBlock' : 'Omit the last semicolon in a one-line block:',
71
	'unusedVars' : 'Unused variables:',
73
	'unusedVars' : 'Unused variables:',
72
	'varRedecl' : 'Variable re-declarations:',
74
	'varRedecl' : 'Variable re-declarations:',
73
	'varShadow': 'Variable shadowing:',
75
	'varShadow': 'Variable shadowing:',
Lines 183-188 define({ Link Here
183
	'backtickQuote' : 'backtick (`)',
185
	'backtickQuote' : 'backtick (`)',
184
	'quoteFixName' : 'Fix quotes',
186
	'quoteFixName' : 'Fix quotes',
185
	'yoda' : 'Require or disallow Yoda conditions:',
187
	'yoda' : 'Require or disallow Yoda conditions:',
188
	'always' : 'Always',
189
	'never' : 'Never',
186
	'yodaKind' : 'Kinds:',
190
	'yodaKind' : 'Kinds:',
187
	'yodaExceptRange' : 'Except for range comparisons:',
191
	'yodaExceptRange' : 'Except for range comparisons:',
188
	'yodaOnlyEquality' : 'Check only for \'==\' and \'===\' operators:',
192
	'yodaOnlyEquality' : 'Check only for \'==\' and \'===\' operators:',
(-)a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/validatorTests.js (-1 / +116 lines)
Lines 10691-10696 define([ Link Here
10691
										id: RULE_ID,
10691
										id: RULE_ID,
10692
										severity: 'warning',
10692
										severity: 'warning',
10693
										description: "Missing semicolon.",
10693
										description: "Missing semicolon.",
10694
										nodeType: "VariableDeclaration"
10695
									},
10696
									{
10697
										id: RULE_ID,
10698
										severity: 'warning',
10699
										description: "Missing semicolon.",
10694
										nodeType: "ExpressionStatement"
10700
										nodeType: "ExpressionStatement"
10695
									}]);
10701
									}]);
10696
								},
10702
								},
Lines 11264-11269 define([ Link Here
11264
									worker.getTestState().callback(error);
11270
									worker.getTestState().callback(error);
11265
								});
11271
								});
11266
						});
11272
						});
11273
						it("should not flag missing semi when 'never' is used", function(callback) {
11274
							var topic = "var name = \"ESLint\"";
11275
							var config = { rules: {} };
11276
							config.rules[RULE_ID] = [2, "never"];
11277
							validate({buffer: topic, callback: callback, config: config}).then(
11278
								function (problems) {
11279
									assertProblems(problems, []);
11280
								},
11281
								function (error) {
11282
									worker.getTestState().callback(error);
11283
								});
11284
						});
11285
						it("should not flag missing semi when 'never' is used with omitLastInOneLineBlock = true", function(callback) {
11286
							var topic = "if (foo) { bar() }";
11287
							var config = { rules: {} };
11288
							config.rules[RULE_ID] = [2, "always", {omitLastInOneLineBlock: true}];
11289
							validate({buffer: topic, callback: callback, config: config}).then(
11290
								function (problems) {
11291
									assertProblems(problems, []);
11292
								},
11293
								function (error) {
11294
									worker.getTestState().callback(error);
11295
								});
11296
						});
11297
						it("should not flag missing semi when 'never' is used with omitLastInOneLineBlock = true 2", function(callback) {
11298
							var topic = "if (foo) { bar(); baz() }";
11299
							var config = { rules: {} };
11300
							config.rules[RULE_ID] = [2, "always", {omitLastInOneLineBlock: true}];
11301
							validate({buffer: topic, callback: callback, config: config}).then(
11302
								function (problems) {
11303
									assertProblems(problems, []);
11304
								},
11305
								function (error) {
11306
									worker.getTestState().callback(error);
11307
								});
11308
						});
11309
						it("should flag missing semi when 'never' is used with omitLastInOneLineBlock = true", function(callback) {
11310
							var topic =
11311
								"if (foo) {\n" +
11312
								"    bar()\n" +
11313
								"}";
11314
							var config = { rules: {} };
11315
							config.rules[RULE_ID] = [2, "always", {omitLastInOneLineBlock: true}];
11316
							validate({buffer: topic, callback: callback, config: config}).then(
11317
								function (problems) {
11318
									assertProblems(problems, [
11319
									{
11320
										id: RULE_ID,
11321
										severity: 'error',
11322
										start: 19,
11323
										end: 20
11324
									}]);
11325
								},
11326
								function (error) {
11327
									worker.getTestState().callback(error);
11328
								});
11329
						});
11330
						it("should flag missing semi when 'never' is used with omitLastInOneLineBlock = true 2", function(callback) {
11331
							var topic =
11332
								"if (foo) { bar(); }";
11333
							var config = { rules: {} };
11334
							config.rules[RULE_ID] = [2, "always", {omitLastInOneLineBlock: true}];
11335
							validate({buffer: topic, callback: callback, config: config}).then(
11336
								function (problems) {
11337
									assertProblems(problems, [
11338
									{
11339
										id: RULE_ID,
11340
										severity: 'error',
11341
										start: 16,
11342
										end: 17
11343
									}]);
11344
								},
11345
								function (error) {
11346
									worker.getTestState().callback(error);
11347
								});
11348
						});
11349
						it("should flag semi when 'never' is set", function(callback) {
11350
							var topic = "if (foo) { bar(); }";
11351
							var config = { rules: {} };
11352
							config.rules[RULE_ID] = [2, "never"];
11353
							validate({buffer: topic, callback: callback, config: config}).then(
11354
								function (problems) {
11355
									assertProblems(problems, [
11356
									{
11357
										id: RULE_ID,
11358
										severity: 'error',
11359
										start: 16,
11360
										end: 17
11361
									}]);
11362
								},
11363
								function (error) {
11364
									worker.getTestState().callback(error);
11365
								});
11366
						});
11367
						it("should not flag semi when 'never' is set", function(callback) {
11368
							var topic = 
11369
								"var name = \"ESLint\"\n" +
11370
								";(function() {\n" +
11371
								"})()";
11372
							var config = { rules: {} };
11373
							config.rules[RULE_ID] = [2, "never"];
11374
							validate({buffer: topic, callback: callback, config: config}).then(
11375
								function (problems) {
11376
									assertProblems(problems, []);
11377
								},
11378
								function (error) {
11379
									worker.getTestState().callback(error);
11380
								});
11381
						});
11267
					});
11382
					});
11268
			
11383
			
11269
					//USE-ISNAN --------------------------------------------------------
11384
					//USE-ISNAN --------------------------------------------------------
Lines 13293-13299 define([ Link Here
13293
						it("flag invalid import/export", function(callback) {
13408
						it("flag invalid import/export", function(callback) {
13294
							var topic = "import * as test from \"./files/es_modules_dep1\"";
13409
							var topic = "import * as test from \"./files/es_modules_dep1\"";
13295
							var config = { rules: {} };
13410
							var config = { rules: {} };
13296
							config.rules[RULE_ID] = 2;
13411
							config.rules[RULE_ID] = [2, "never"];
13297
							var features = Object.create(null);
13412
							var features = Object.create(null);
13298
							features.modules = false;
13413
							features.modules = false;
13299
							config.ecmaFeatures = features;
13414
							config.ecmaFeatures = features;
(-)a/bundles/org.eclipse.orion.client.javascript/web/javascript/plugins/javascriptPlugin.js (-23 / +36 lines)
Lines 1465-1489 define([ Link Here
1465
    	 * ESLint settings
1465
    	 * ESLint settings
1466
    	 */
1466
    	 */
1467
    	var ignore = 0, warning = 1, error = 2, severities = [
1467
    	var ignore = 0, warning = 1, error = 2, severities = [
1468
    	                                                      {label: javascriptMessages.ignore,  value: ignore},
1468
    	                                                      {label: javascriptMessages['ignore'],  value: ignore},
1469
    	                                                      {label: javascriptMessages.warning, value: warning},
1469
    	                                                      {label: javascriptMessages['warning'], value: warning},
1470
    	                                                      {label: javascriptMessages.error,   value: error}
1470
    	                                                      {label: javascriptMessages['error'], value: error}
1471
    	                                                      ];
1471
    	                                                      ];
1472
    	                                                      
1472
    	                                                      
1473
		var doubleQuote = 'double';
1473
		var doubleQuote = 'double';
1474
		var singleQuote = 'single';
1474
		var singleQuote = 'single';
1475
		var backTick = 'backtick';
1475
		var backTick = 'backtick';
1476
		var quotes = [
1476
		var quotes = [
1477
			{ label: javascriptMessages.singleQuote, value: singleQuote },
1477
			{ label: javascriptMessages['singleQuote'], value: singleQuote },
1478
			{ label: javascriptMessages.doubleQuote, value: doubleQuote },
1478
			{ label: javascriptMessages['doubleQuote'], value: doubleQuote },
1479
			{ label: javascriptMessages.backtickQuote, value: backTick }
1479
			{ label: javascriptMessages['backtickQuote'], value: backTick }
1480
		];
1480
		];
1481
		
1481
		
1482
		var Never = 'never';
1482
		var Never = 'never';
1483
		var Always = 'always';
1483
		var Always = 'always';
1484
		var yodaKinds = [
1484
		var kinds = [
1485
			{ label: javascriptMessages.yodayAlways, value: Always },
1485
			{ label: javascriptMessages['always'], value: Always },
1486
			{ label: javascriptMessages.yodaNever, value: Never },
1486
			{ label: javascriptMessages['never'], value: Never },
1487
		];
1487
		];
1488
    	provider.registerService("orion.core.setting",  //$NON-NLS-1$
1488
    	provider.registerService("orion.core.setting",  //$NON-NLS-1$
1489
    			{},
1489
    			{},
Lines 1959-1965 define([ Link Here
1959
    			 	        	                	name: javascriptMessages["yodaKind"],
1959
    			 	        	                	name: javascriptMessages["yodaKind"],
1960
    			 	        	                	type: "string",  //$NON-NLS-1$
1960
    			 	        	                	type: "string",  //$NON-NLS-1$
1961
    			 	        	                	defaultValue: Never,
1961
    			 	        	                	defaultValue: Never,
1962
    			 	        	                	options: yodaKinds
1962
    			 	        	                	options: kinds
1963
    			 	        	                },
1963
    			 	        	                },
1964
 				 	        	            	{
1964
 				 	        	            	{
1965
	 				 	        	            	id: "yoda:exceptRange",  //$NON-NLS-1$
1965
	 				 	        	            	id: "yoda:exceptRange",  //$NON-NLS-1$
Lines 2057-2062 define([ Link Here
2057
				 	        	                	defaultValue: warning,
2057
				 	        	                	defaultValue: warning,
2058
				 	        	                	options: severities
2058
				 	        	                	options: severities
2059
				 	        	                },
2059
				 	        	                },
2060
				 	        	                {	id: "semi!1",  //$NON-NLS-1$
2061
				 	        	                	dependsOn: "semi",
2062
				 	        	                	name: javascriptMessages["missingSemiFineGrained"],
2063
				 	        	                	type: "string",  //$NON-NLS-1$
2064
				 	        	                	defaultValue: Always,
2065
				 	        	                	options: kinds
2066
				 	        	                },
2067
				 	        	                {	id: "semi:omitLastInOneLineBlock",  //$NON-NLS-1$
2068
				 	        	                	dependsOn: "semi",
2069
				 	        	                	name: javascriptMessages["missingSemiOmitLastInOneLineBlock"],
2070
				 	        	                	type: "boolean",  //$NON-NLS-1$
2071
				 	        	                	defaultValue: false
2072
				 	        	                },
2060
				 	        	                {	id: "no-mixed-spaces-and-tabs",  //$NON-NLS-1$
2073
				 	        	                {	id: "no-mixed-spaces-and-tabs",  //$NON-NLS-1$
2061
				 	        	                	name: javascriptMessages["noMixedSpacesAndTabs"],
2074
				 	        	                	name: javascriptMessages["noMixedSpacesAndTabs"],
2062
				 	        	                	type: "number",  //$NON-NLS-1$
2075
				 	        	                	type: "number",  //$NON-NLS-1$
Lines 2126-2150 define([ Link Here
2126
		var mac = "\r";
2139
		var mac = "\r";
2127
		var windows = "\n\r";
2140
		var windows = "\n\r";
2128
		var eof_characters = [
2141
		var eof_characters = [
2129
			{label: javascriptMessages.indentation_unix,  value: unix},
2142
			{label: javascriptMessages['indentation_unix'],  value: unix},
2130
			{label: javascriptMessages.indentation_mac, value: mac},
2143
			{label: javascriptMessages['indentation_mac'], value: mac},
2131
			{label: javascriptMessages.indentation_windows, value: windows}
2144
			{label: javascriptMessages['indentation_windows'], value: windows}
2132
		];
2145
		];
2133
2146
2134
		var space = ' ';
2147
		var space = ' ';
2135
		var tab= '\t';
2148
		var tab= '\t';
2136
		var indentation_characters = [
2149
		var indentation_characters = [
2137
			{label: javascriptMessages.indentation_space,  value: space},
2150
			{label: javascriptMessages['indentation_space'],  value: space},
2138
			{label: javascriptMessages.indentation_tab,  value: tab},
2151
			{label: javascriptMessages['indentation_tab'],  value: tab},
2139
		];
2152
		];
2140
		
2153
		
2141
		var before_newline = 'before-newline';
2154
		var before_newline = 'before-newline';
2142
		var after_newline = 'after-newline';
2155
		var after_newline = 'after-newline';
2143
		var preserve_newline = 'preserve-newline';
2156
		var preserve_newline = 'preserve-newline';
2144
		var operator_positions = [
2157
		var operator_positions = [
2145
			{ label: javascriptMessages.before_newline, value: before_newline},
2158
			{ label: javascriptMessages['before_newline'], value: before_newline},
2146
			{ label: javascriptMessages.after_newline, value: after_newline},
2159
			{ label: javascriptMessages['after_newline'], value: after_newline},
2147
			{ label: javascriptMessages.preserve_newline, value: preserve_newline},
2160
			{ label: javascriptMessages['preserve_newline'], value: preserve_newline},
2148
		];
2161
		];
2149
		
2162
		
2150
		var collapse_preserve_inline = 'collapse-preserve-inline';
2163
		var collapse_preserve_inline = 'collapse-preserve-inline';
Lines 2153-2163 define([ Link Here
2153
		var end_expand = 'end-expand';
2166
		var end_expand = 'end-expand';
2154
		var none = 'none';
2167
		var none = 'none';
2155
		var brace_styles = [
2168
		var brace_styles = [
2156
			{ label: javascriptMessages.collapse_preserve_inline , value: collapse_preserve_inline},
2169
			{ label: javascriptMessages['collapse_preserve_inline'], value: collapse_preserve_inline},
2157
			{ label: javascriptMessages.collapse , value: collapse},
2170
			{ label: javascriptMessages['collapse'], value: collapse},
2158
			{ label: javascriptMessages.expand , value: expand},
2171
			{ label: javascriptMessages['expand'], value: expand},
2159
			{ label: javascriptMessages.end_expand , value: end_expand},
2172
			{ label: javascriptMessages['end_expand'], value: end_expand},
2160
			{ label: javascriptMessages.none , value: none},
2173
			{ label: javascriptMessages['none'], value: none},
2161
		];
2174
		];
2162
		provider.registerServiceProvider("orion.core.setting", {}, {
2175
		provider.registerServiceProvider("orion.core.setting", {}, {
2163
			settings: [
2176
			settings: [

Return to bug 499665