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

Side by Side Diff: lib/runtime/dart_runtime.js

Issue 1034273003: fix for static methods and names banned in strict mode (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 8 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/dart_core.js ('k') | lib/src/codegen/js_codegen.dart » ('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, _js_helper; 5 var dart, _js_helper;
6 (function (dart) { 6 (function (dart) {
7 'use strict'; 7 'use strict';
8 8
9 var defineProperty = Object.defineProperty; 9 var defineProperty = Object.defineProperty;
10 var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; 10 var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 dart.assert = assert; 273 dart.assert = assert;
274 274
275 function throw_(obj) { throw obj; } 275 function throw_(obj) { throw obj; }
276 dart.throw_ = throw_; 276 dart.throw_ = throw_;
277 277
278 /** 278 /**
279 * Given a class and an initializer method name, creates a constructor 279 * Given a class and an initializer method name, creates a constructor
280 * function with the same name. For example `new SomeClass.name(args)`. 280 * function with the same name. For example `new SomeClass.name(args)`.
281 */ 281 */
282 function defineNamedConstructor(clazz, name) { 282 function defineNamedConstructor(clazz, name) {
283 var shortName = name.startsWith('::') ? name.substring(2) : name;
283 var proto = clazz.prototype; 284 var proto = clazz.prototype;
284 var initMethod = proto[clazz.name + '$' + name]; 285 var initMethod = proto[clazz.name + '$' + shortName];
285 var ctor = function() { return initMethod.apply(this, arguments); } 286 var ctor = function() { return initMethod.apply(this, arguments); }
286 ctor.prototype = proto; 287 ctor.prototype = proto;
287 clazz[name] = ctor; 288 clazz[name] = ctor;
288 } 289 }
289 dart.defineNamedConstructor = defineNamedConstructor; 290 dart.defineNamedConstructor = defineNamedConstructor;
290 291
291 function stackTrace(exception) { 292 function stackTrace(exception) {
292 throw new core.UnimplementedError(); 293 throw new core.UnimplementedError();
293 } 294 }
294 dart.stackTrace = stackTrace; 295 dart.stackTrace = stackTrace;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 // of some sort, assuming we keep around `dynamic` at runtime. 339 // of some sort, assuming we keep around `dynamic` at runtime.
339 dart.dynamic = Object.create(null); 340 dart.dynamic = Object.create(null);
340 341
341 dart.JsSymbol = Symbol; 342 dart.JsSymbol = Symbol;
342 343
343 // TODO(jmesserly): hack to bootstrap the SDK 344 // TODO(jmesserly): hack to bootstrap the SDK
344 _js_helper = _js_helper || {}; 345 _js_helper = _js_helper || {};
345 _js_helper.checkNum = notNull; 346 _js_helper.checkNum = notNull;
346 347
347 })(dart || (dart = {})); 348 })(dart || (dart = {}));
OLDNEW
« no previous file with comments | « lib/runtime/dart_core.js ('k') | lib/src/codegen/js_codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698