| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 = {})); |
| OLD | NEW |