| 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) { |
| 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) | 26 if (!condition) |
| 27 throwInternalError("The compiler is broken: failed assert"); | 27 throwInternalError("The compiler is broken: failed assert"); |
| 28 } | 28 } |
| 29 function getOwnNamesAndSymbols(obj) { | 29 function getOwnNamesAndSymbols(obj) { |
| 30 return getOwnPropertyNames(obj).concat(getOwnPropertySymbols(obj)); | 30 return getOwnPropertyNames(obj).concat(getOwnPropertySymbols(obj)); |
| 31 } | 31 } |
| 32 function safeGetOwnProperty(obj, name) { | 32 function safeGetOwnProperty(obj, name) { |
| 33 let desc = getOwnPropertyDescriptor(obj, name); | 33 let desc = getOwnPropertyDescriptor(obj, name); |
| 34 if (desc) | 34 if (desc) |
| 35 return desc.value; | 35 return desc.value; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 defineProperty(to, name, desc); | 73 defineProperty(to, name, desc); |
| 74 } else { | 74 } else { |
| 75 defineLazyProperty(to, name, () => from[name]); | 75 defineLazyProperty(to, name, () => from[name]); |
| 76 } | 76 } |
| 77 } | 77 } |
| 78 return to; | 78 return to; |
| 79 } | 79 } |
| 80 function copyProperties(to, from) { | 80 function copyProperties(to, from) { |
| 81 return copyTheseProperties(to, from, getOwnNamesAndSymbols(from)); | 81 return copyTheseProperties(to, from, getOwnNamesAndSymbols(from)); |
| 82 } | 82 } |
| 83 function export_(to, from, show, hide) { | 83 function export$(to, from, show, hide) { |
| 84 if (show == void 0 || show.length == 0) { | 84 if (show == void 0 || show.length == 0) { |
| 85 show = getOwnNamesAndSymbols(from); | 85 show = getOwnNamesAndSymbols(from); |
| 86 } | 86 } |
| 87 if (hide != void 0) { | 87 if (hide != void 0) { |
| 88 var hideMap = new Set(hide); | 88 var hideMap = new Set(hide); |
| 89 show = show.filter(k => !hideMap.has(k)); | 89 show = show.filter(k => !hideMap.has(k)); |
| 90 } | 90 } |
| 91 return copyTheseProperties(to, from, show); | 91 return copyTheseProperties(to, from, show); |
| 92 } | 92 } |
| 93 // Exports: | 93 // Exports: |
| 94 exports.defineProperty = defineProperty; | 94 exports.defineProperty = defineProperty; |
| 95 exports.getOwnPropertyDescriptor = getOwnPropertyDescriptor; | 95 exports.getOwnPropertyDescriptor = getOwnPropertyDescriptor; |
| 96 exports.getOwnPropertyNames = getOwnPropertyNames; | 96 exports.getOwnPropertyNames = getOwnPropertyNames; |
| 97 exports.getOwnPropertySymbols = getOwnPropertySymbols; | 97 exports.getOwnPropertySymbols = getOwnPropertySymbols; |
| 98 exports.hasOwnProperty = hasOwnProperty; | 98 exports.hasOwnProperty = hasOwnProperty; |
| 99 exports.StrongModeError = StrongModeError; | 99 exports.StrongModeError = StrongModeError; |
| 100 exports.throwStrongModeError = throwStrongModeError; | 100 exports.throwStrongModeError = throwStrongModeError; |
| 101 exports.throwInternalError = throwInternalError; | 101 exports.throwInternalError = throwInternalError; |
| 102 exports.assert_ = assert_; | 102 exports.assert = assert; |
| 103 exports.getOwnNamesAndSymbols = getOwnNamesAndSymbols; | 103 exports.getOwnNamesAndSymbols = getOwnNamesAndSymbols; |
| 104 exports.safeGetOwnProperty = safeGetOwnProperty; | 104 exports.safeGetOwnProperty = safeGetOwnProperty; |
| 105 exports.defineLazyProperty = defineLazyProperty; | 105 exports.defineLazyProperty = defineLazyProperty; |
| 106 exports.defineLazy = defineLazy; | 106 exports.defineLazy = defineLazy; |
| 107 exports.defineMemoizedGetter = defineMemoizedGetter; | 107 exports.defineMemoizedGetter = defineMemoizedGetter; |
| 108 exports.copyTheseProperties = copyTheseProperties; | 108 exports.copyTheseProperties = copyTheseProperties; |
| 109 exports.copyProperties = copyProperties; | 109 exports.copyProperties = copyProperties; |
| 110 exports.export_ = export_; | 110 exports.export = export$; |
| 111 }); | 111 }); |
| OLD | NEW |