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

Side by Side Diff: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/utils.dart

Issue 2869463002: Better stack trace support (Closed)
Patch Set: Address comments Created 3 years, 7 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
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 part of dart._runtime; 4 part of dart._runtime;
5 5
6 /// This library defines a set of general javascript utilities for us 6 /// This library defines a set of general javascript utilities for us
7 /// by the Dart runtime. 7 /// by the Dart runtime.
8 // TODO(ochafik): Rewrite some of these in Dart when possible. 8 // TODO(ochafik): Rewrite some of these in Dart when possible.
9 9
10 defineProperty(obj, name, desc) => 10 defineProperty(obj, name, desc) =>
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 '', 53 '',
54 '''(() => { 54 '''(() => {
55 let init = $desc.get; 55 let init = $desc.get;
56 let value = null; 56 let value = null;
57 57
58 function lazySetter(x) { 58 function lazySetter(x) {
59 init = null; 59 init = null;
60 value = x; 60 value = x;
61 } 61 }
62 function circularInitError() { 62 function circularInitError() {
63 $throwInternalError('circular initialization for field ' + $name); 63 $throwCyclicInitializationError($name);
64 } 64 }
65 function lazyGetter() { 65 function lazyGetter() {
66 if (init == null) return value; 66 if (init == null) return value;
67 67
68 // Compute and store the value, guarding against reentry. 68 // Compute and store the value, guarding against reentry.
69 let f = init; 69 let f = init;
70 init = circularInitError; 70 init = circularInitError;
71 lazySetter(f()); 71 lazySetter(f());
72 return value; 72 return value;
73 } 73 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 } 117 }
118 118
119 @JSExportName('export') 119 @JSExportName('export')
120 exportProperty(to, from, name) => copyProperty(to, from, name); 120 exportProperty(to, from, name) => copyProperty(to, from, name);
121 121
122 /// Copy properties from source to destination object. 122 /// Copy properties from source to destination object.
123 /// This operation is commonly called `mixin` in JS. 123 /// This operation is commonly called `mixin` in JS.
124 copyProperties(to, from) { 124 copyProperties(to, from) {
125 return copyTheseProperties(to, from, getOwnNamesAndSymbols(from)); 125 return copyTheseProperties(to, from, getOwnNamesAndSymbols(from));
126 } 126 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698