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

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

Issue 2621823002: Disable auto "debugger" call for tests (Closed)
Patch Set: Created 3 years, 11 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 | « pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/errors.dart ('k') | no next file » | 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 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) =>
11 JS('', 'Object.defineProperty(#, #, #)', obj, name, desc); 11 JS('', 'Object.defineProperty(#, #, #)', obj, name, desc);
12 12
13 getOwnPropertyDescriptor(obj, name) => 13 getOwnPropertyDescriptor(obj, name) =>
14 JS('', 'Object.getOwnPropertyDescriptor(#, #)', obj, name); 14 JS('', 'Object.getOwnPropertyDescriptor(#, #)', obj, name);
15 15
16 Iterable getOwnPropertyNames(obj) => 16 Iterable getOwnPropertyNames(obj) =>
17 JS('', 'Object.getOwnPropertyNames(#)', obj); 17 JS('', 'Object.getOwnPropertyNames(#)', obj);
18 18
19 Iterable getOwnPropertySymbols(obj) => 19 Iterable getOwnPropertySymbols(obj) =>
20 JS('', 'Object.getOwnPropertySymbols(#)', obj); 20 JS('', 'Object.getOwnPropertySymbols(#)', obj);
21 21
22 final hasOwnProperty = JS('', 'Object.prototype.hasOwnProperty'); 22 final hasOwnProperty = JS('', 'Object.prototype.hasOwnProperty');
23 23
24 /// This error indicates a strong mode specific failure, other than a type 24 /// This error indicates a strong mode specific failure, other than a type
25 /// assertion failure (TypeError) or CastError. 25 /// assertion failure (TypeError) or CastError.
26 void throwStrongModeError(String message) { 26 void throwStrongModeError(String message) {
27 JS('', 'debugger'); 27 if (_trapRuntimeErrors) JS('', 'debugger');
28 JS('', 'throw new #(#);', StrongModeErrorImplementation, message); 28 JS('', 'throw new #(#);', StrongModeErrorImplementation, message);
29 } 29 }
30 30
31 /// This error indicates a bug in the runtime or the compiler. 31 /// This error indicates a bug in the runtime or the compiler.
32 void throwInternalError(String message) { 32 void throwInternalError(String message) {
33 JS('', 'debugger'); 33 if (_trapRuntimeErrors) JS('', 'debugger');
34 JS('', 'throw Error(#)', message); 34 JS('', 'throw Error(#)', message);
35 } 35 }
36 36
37 getOwnNamesAndSymbols(obj) { 37 getOwnNamesAndSymbols(obj) {
38 var names = getOwnPropertyNames(obj); 38 var names = getOwnPropertyNames(obj);
39 var symbols = getOwnPropertySymbols(obj); 39 var symbols = getOwnPropertySymbols(obj);
40 return JS('', '#.concat(#)', names, symbols); 40 return JS('', '#.concat(#)', names, symbols);
41 } 41 }
42 42
43 safeGetOwnProperty(obj, String name) { 43 safeGetOwnProperty(obj, String name) {
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 } 111 }
112 112
113 @JSExportName('export') 113 @JSExportName('export')
114 exportProperty(to, from, name) => copyProperty(to, from, name); 114 exportProperty(to, from, name) => copyProperty(to, from, name);
115 115
116 /// Copy properties from source to destination object. 116 /// Copy properties from source to destination object.
117 /// This operation is commonly called `mixin` in JS. 117 /// This operation is commonly called `mixin` in JS.
118 copyProperties(to, from) { 118 copyProperties(to, from) {
119 return copyTheseProperties(to, from, getOwnNamesAndSymbols(from)); 119 return copyTheseProperties(to, from, getOwnNamesAndSymbols(from));
120 } 120 }
OLDNEW
« no previous file with comments | « pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/errors.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698