Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(470)

Side by Side Diff: test/codegen/expect/server_mode/dev_compiler/runtime/dart_runtime.js

Issue 1002443002: minor code cleanup (Closed) Base URL: git@github.com:dart-lang/dart-dev-compiler.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/runtime/run.js ('k') | test/codegen/expect/server_mode/html_input.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 var dart; 5 var dart;
6 (function (dart) { 6 (function (dart) {
7 var defineProperty = Object.defineProperty; 7 var defineProperty = Object.defineProperty;
8 var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; 8 var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
9 var getOwnPropertyNames = Object.getOwnPropertyNames; 9 var getOwnPropertyNames = Object.getOwnPropertyNames;
10 10
11 // Adapted from Angular.js 11 // Adapted from Angular.js
12 var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m; 12 var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m;
13 var FN_ARG_SPLIT = /,/; 13 var FN_ARG_SPLIT = /,/;
14 var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/; 14 var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/;
15 var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg; 15 var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
16 16
17 function formalParameterList(fn) { 17 function formalParameterList(fn) {
18 var fnText,argDecl; 18 var fnText,argDecl;
19 var args=[]; 19 var args=[];
20 fnText = fn.toString().replace(STRIP_COMMENTS, ''); 20 fnText = fn.toString().replace(STRIP_COMMENTS, '');
21 argDecl = fnText.match(FN_ARGS); 21 argDecl = fnText.match(FN_ARGS);
22 22
23 var r = argDecl[1].split(FN_ARG_SPLIT); 23 var r = argDecl[1].split(FN_ARG_SPLIT);
24 for(var a in r){ 24 for(var a in r) {
25 var arg = r[a]; 25 var arg = r[a];
26 arg.replace(FN_ARG, function(all, underscore, name){ 26 arg.replace(FN_ARG, function(all, underscore, name){
27 args.push(name); 27 args.push(name);
28 }); 28 });
29 } 29 }
30 return args; 30 return args;
31 } 31 }
32 32
33 function dload(obj, field) { 33 function dload(obj, field) {
34 if (!(field in obj)) { 34 if (!(field in obj)) {
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 var init = this[name]; 348 var init = this[name];
349 var result = void 0; 349 var result = void 0;
350 if (init) result = init.apply(this, arguments); 350 if (init) result = init.apply(this, arguments);
351 return result === void 0 ? this : result; 351 return result === void 0 ? this : result;
352 }; 352 };
353 // The initializer for dart.Object 353 // The initializer for dart.Object
354 dart.Object.prototype.Object = function() {}; 354 dart.Object.prototype.Object = function() {};
355 dart.Object.prototype.constructor = dart.Object; 355 dart.Object.prototype.constructor = dart.Object;
356 356
357 })(dart || (dart = {})); 357 })(dart || (dart = {}));
OLDNEW
« no previous file with comments | « lib/runtime/run.js ('k') | test/codegen/expect/server_mode/html_input.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698