OLD | NEW |
1 dart_library.library('dart/_utils', null, /* Imports */[ | 1 dart_library.library('dart/_utils', null, /* Imports */[ |
2 ], /* Lazy imports */[ | 2 ], /* Lazy imports */[ |
3 ], function(exports, dart) { | 3 ], function(exports, dart) { |
4 'use strict'; | 4 'use strict'; |
5 const defineProperty = Object.defineProperty; | 5 const defineProperty = Object.defineProperty; |
6 const getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; | 6 const getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; |
7 const getOwnPropertyNames = Object.getOwnPropertyNames; | 7 const getOwnPropertyNames = Object.getOwnPropertyNames; |
8 const getOwnPropertySymbols = Object.getOwnPropertySymbols; | 8 const getOwnPropertySymbols = Object.getOwnPropertySymbols; |
9 const hasOwnProperty = Object.prototype.hasOwnProperty; | 9 const hasOwnProperty = Object.prototype.hasOwnProperty; |
10 const StrongModeError = (function() { | 10 const StrongModeError = (function() { |
11 function StrongModeError(message) { | 11 function StrongModeError(message) { |
12 Error.call(this); | 12 Error.call(this); |
13 this.message = message; | 13 this.message = message; |
14 } | 14 } |
15 ; | 15 ; |
16 Object.setPrototypeOf(StrongModeError.prototype, Error.prototype); | 16 Object.setPrototypeOf(StrongModeError.prototype, Error.prototype); |
17 return StrongModeError; | 17 return StrongModeError; |
18 })(); | 18 })(); |
19 function throwStrongModeError(message) { | 19 function throwStrongModeError(message) { |
20 throw new StrongModeError(message); | 20 throw new StrongModeError(message); |
21 } | 21 } |
22 function throwInternalError(message) { | 22 function throwInternalError(message) { |
23 throw Error(message); | 23 throw Error(message); |
24 } | 24 } |
25 function assert_(condition) { | 25 function assert(condition) { |
26 if (!condition) throwInternalError("The compiler is broken: failed assert"); | 26 if (!condition) throwInternalError("The compiler is broken: failed assert"); |
27 } | 27 } |
28 function getOwnNamesAndSymbols(obj) { | 28 function getOwnNamesAndSymbols(obj) { |
29 return getOwnPropertyNames(obj).concat(getOwnPropertySymbols(obj)); | 29 return getOwnPropertyNames(obj).concat(getOwnPropertySymbols(obj)); |
30 } | 30 } |
31 function safeGetOwnProperty(obj, name) { | 31 function safeGetOwnProperty(obj, name) { |
32 let desc = getOwnPropertyDescriptor(obj, name); | 32 let desc = getOwnPropertyDescriptor(obj, name); |
33 if (desc) return desc.value; | 33 if (desc) return desc.value; |
34 } | 34 } |
35 function defineLazyProperty(to, name, desc) { | 35 function defineLazyProperty(to, name, desc) { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 } | 88 } |
89 // Exports: | 89 // Exports: |
90 exports.defineProperty = defineProperty; | 90 exports.defineProperty = defineProperty; |
91 exports.getOwnPropertyDescriptor = getOwnPropertyDescriptor; | 91 exports.getOwnPropertyDescriptor = getOwnPropertyDescriptor; |
92 exports.getOwnPropertyNames = getOwnPropertyNames; | 92 exports.getOwnPropertyNames = getOwnPropertyNames; |
93 exports.getOwnPropertySymbols = getOwnPropertySymbols; | 93 exports.getOwnPropertySymbols = getOwnPropertySymbols; |
94 exports.hasOwnProperty = hasOwnProperty; | 94 exports.hasOwnProperty = hasOwnProperty; |
95 exports.StrongModeError = StrongModeError; | 95 exports.StrongModeError = StrongModeError; |
96 exports.throwStrongModeError = throwStrongModeError; | 96 exports.throwStrongModeError = throwStrongModeError; |
97 exports.throwInternalError = throwInternalError; | 97 exports.throwInternalError = throwInternalError; |
98 exports.assert_ = assert_; | 98 exports.assert = assert; |
99 exports.getOwnNamesAndSymbols = getOwnNamesAndSymbols; | 99 exports.getOwnNamesAndSymbols = getOwnNamesAndSymbols; |
100 exports.safeGetOwnProperty = safeGetOwnProperty; | 100 exports.safeGetOwnProperty = safeGetOwnProperty; |
101 exports.defineLazyProperty = defineLazyProperty; | 101 exports.defineLazyProperty = defineLazyProperty; |
102 exports.defineLazy = defineLazy; | 102 exports.defineLazy = defineLazy; |
103 exports.defineMemoizedGetter = defineMemoizedGetter; | 103 exports.defineMemoizedGetter = defineMemoizedGetter; |
104 exports.copyTheseProperties = copyTheseProperties; | 104 exports.copyTheseProperties = copyTheseProperties; |
105 exports.copyProperties = copyProperties; | 105 exports.copyProperties = copyProperties; |
106 exports.export_ = export_; | 106 exports.export_ = export_; |
107 }); | 107 }); |
OLD | NEW |