mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
don't build angular
This commit is contained in:
278
config.js
278
config.js
@ -1,276 +1,28 @@
|
||||
System.config({
|
||||
"baseURL": "/",
|
||||
"transpiler": "babel",
|
||||
"babelOptions": {
|
||||
"optional": [
|
||||
"runtime"
|
||||
]
|
||||
},
|
||||
"transpiler": "traceur",
|
||||
"paths": {
|
||||
"*": "*.js",
|
||||
"github:*": "jspm_packages/github/*.js",
|
||||
"npm:*": "jspm_packages/npm/*.js",
|
||||
"*": "*.js"
|
||||
"ionic/*": "dist/js/ionic.bundle.js",
|
||||
"angular2/*": "scripts/resources/angular2.dev.js"
|
||||
},
|
||||
"bundles": {
|
||||
"dist/js/ionic.bundle": [
|
||||
"ionic"
|
||||
],
|
||||
"scripts/resources/angular2.dev": [
|
||||
"angular2"
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
System.config({
|
||||
"map": {
|
||||
"angular2": "npm:angular2@2.0.0-alpha.27",
|
||||
"babel": "npm:babel-core@5.4.7",
|
||||
"babel-core": "npm:babel-core@5.4.7",
|
||||
"babel-runtime": "npm:babel-runtime@5.4.7",
|
||||
"core-js": "npm:core-js@0.9.14",
|
||||
"rx": "npm:rx@2.5.3",
|
||||
"github:jspm/nodelibs-assert@0.1.0": {
|
||||
"assert": "npm:assert@1.3.0"
|
||||
},
|
||||
"github:jspm/nodelibs-buffer@0.1.0": {
|
||||
"buffer": "npm:buffer@3.2.2"
|
||||
},
|
||||
"github:jspm/nodelibs-constants@0.1.0": {
|
||||
"constants-browserify": "npm:constants-browserify@0.0.1"
|
||||
},
|
||||
"github:jspm/nodelibs-crypto@0.1.0": {
|
||||
"crypto-browserify": "npm:crypto-browserify@3.9.14"
|
||||
},
|
||||
"github:jspm/nodelibs-events@0.1.1": {
|
||||
"events": "npm:events@1.0.2"
|
||||
},
|
||||
"github:jspm/nodelibs-path@0.1.0": {
|
||||
"path-browserify": "npm:path-browserify@0.0.0"
|
||||
},
|
||||
"github:jspm/nodelibs-process@0.1.1": {
|
||||
"process": "npm:process@0.10.1"
|
||||
},
|
||||
"github:jspm/nodelibs-stream@0.1.0": {
|
||||
"stream-browserify": "npm:stream-browserify@1.0.0"
|
||||
},
|
||||
"github:jspm/nodelibs-url@0.1.0": {
|
||||
"url": "npm:url@0.10.3"
|
||||
},
|
||||
"github:jspm/nodelibs-util@0.1.0": {
|
||||
"util": "npm:util@0.10.3"
|
||||
},
|
||||
"github:jspm/nodelibs-vm@0.1.0": {
|
||||
"vm-browserify": "npm:vm-browserify@0.0.4"
|
||||
},
|
||||
"npm:angular2@2.0.0-alpha.27": {
|
||||
"fs": "github:jspm/nodelibs-fs@0.1.2",
|
||||
"path": "github:jspm/nodelibs-path@0.1.0",
|
||||
"process": "github:jspm/nodelibs-process@0.1.1",
|
||||
"reflect-metadata": "npm:reflect-metadata@0.1.0",
|
||||
"rx": "npm:rx@2.5.1",
|
||||
"url": "github:jspm/nodelibs-url@0.1.0",
|
||||
"zone.js": "npm:zone.js@0.5.1"
|
||||
},
|
||||
"npm:asn1.js@2.0.4": {
|
||||
"assert": "github:jspm/nodelibs-assert@0.1.0",
|
||||
"bn.js": "npm:bn.js@2.0.5",
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"inherits": "npm:inherits@2.0.1",
|
||||
"minimalistic-assert": "npm:minimalistic-assert@1.0.0",
|
||||
"vm": "github:jspm/nodelibs-vm@0.1.0"
|
||||
},
|
||||
"npm:assert@1.3.0": {
|
||||
"util": "npm:util@0.10.3"
|
||||
},
|
||||
"npm:browserify-aes@1.0.1": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"create-hash": "npm:create-hash@1.1.1",
|
||||
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
|
||||
"fs": "github:jspm/nodelibs-fs@0.1.2",
|
||||
"inherits": "npm:inherits@2.0.1",
|
||||
"stream": "github:jspm/nodelibs-stream@0.1.0",
|
||||
"systemjs-json": "github:systemjs/plugin-json@0.1.0"
|
||||
},
|
||||
"npm:browserify-rsa@2.0.1": {
|
||||
"bn.js": "npm:bn.js@2.0.5",
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"constants": "github:jspm/nodelibs-constants@0.1.0",
|
||||
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
|
||||
"randombytes": "npm:randombytes@2.0.1"
|
||||
},
|
||||
"npm:browserify-sign@3.0.2": {
|
||||
"bn.js": "npm:bn.js@2.0.5",
|
||||
"browserify-rsa": "npm:browserify-rsa@2.0.1",
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"create-hash": "npm:create-hash@1.1.1",
|
||||
"create-hmac": "npm:create-hmac@1.1.3",
|
||||
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
|
||||
"elliptic": "npm:elliptic@3.1.0",
|
||||
"inherits": "npm:inherits@2.0.1",
|
||||
"parse-asn1": "npm:parse-asn1@3.0.1",
|
||||
"stream": "github:jspm/nodelibs-stream@0.1.0",
|
||||
"systemjs-json": "github:systemjs/plugin-json@0.1.0"
|
||||
},
|
||||
"npm:buffer@3.2.2": {
|
||||
"base64-js": "npm:base64-js@0.0.8",
|
||||
"ieee754": "npm:ieee754@1.1.6",
|
||||
"is-array": "npm:is-array@1.0.1"
|
||||
},
|
||||
"npm:constants-browserify@0.0.1": {
|
||||
"systemjs-json": "github:systemjs/plugin-json@0.1.0"
|
||||
},
|
||||
"npm:core-js@0.9.14": {
|
||||
"fs": "github:jspm/nodelibs-fs@0.1.2",
|
||||
"process": "github:jspm/nodelibs-process@0.1.1",
|
||||
"systemjs-json": "github:systemjs/plugin-json@0.1.0"
|
||||
},
|
||||
"npm:core-util-is@1.0.1": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0"
|
||||
},
|
||||
"npm:create-ecdh@2.0.1": {
|
||||
"bn.js": "npm:bn.js@2.0.5",
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
|
||||
"elliptic": "npm:elliptic@3.1.0"
|
||||
},
|
||||
"npm:create-hash@1.1.1": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
|
||||
"fs": "github:jspm/nodelibs-fs@0.1.2",
|
||||
"inherits": "npm:inherits@2.0.1",
|
||||
"ripemd160": "npm:ripemd160@1.0.1",
|
||||
"sha.js": "npm:sha.js@2.4.2",
|
||||
"stream": "github:jspm/nodelibs-stream@0.1.0"
|
||||
},
|
||||
"npm:create-hmac@1.1.3": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"create-hash": "npm:create-hash@1.1.1",
|
||||
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
|
||||
"inherits": "npm:inherits@2.0.1",
|
||||
"stream": "github:jspm/nodelibs-stream@0.1.0"
|
||||
},
|
||||
"npm:crypto-browserify@3.9.14": {
|
||||
"browserify-aes": "npm:browserify-aes@1.0.1",
|
||||
"browserify-sign": "npm:browserify-sign@3.0.2",
|
||||
"create-ecdh": "npm:create-ecdh@2.0.1",
|
||||
"create-hash": "npm:create-hash@1.1.1",
|
||||
"create-hmac": "npm:create-hmac@1.1.3",
|
||||
"diffie-hellman": "npm:diffie-hellman@3.0.2",
|
||||
"inherits": "npm:inherits@2.0.1",
|
||||
"pbkdf2": "npm:pbkdf2@3.0.4",
|
||||
"public-encrypt": "npm:public-encrypt@2.0.1",
|
||||
"randombytes": "npm:randombytes@2.0.1"
|
||||
},
|
||||
"npm:diffie-hellman@3.0.2": {
|
||||
"bn.js": "npm:bn.js@2.0.5",
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
|
||||
"miller-rabin": "npm:miller-rabin@2.0.1",
|
||||
"randombytes": "npm:randombytes@2.0.1",
|
||||
"systemjs-json": "github:systemjs/plugin-json@0.1.0"
|
||||
},
|
||||
"npm:elliptic@3.1.0": {
|
||||
"bn.js": "npm:bn.js@2.0.5",
|
||||
"brorand": "npm:brorand@1.0.5",
|
||||
"hash.js": "npm:hash.js@1.0.3",
|
||||
"inherits": "npm:inherits@2.0.1",
|
||||
"systemjs-json": "github:systemjs/plugin-json@0.1.0"
|
||||
},
|
||||
"npm:hash.js@1.0.3": {
|
||||
"inherits": "npm:inherits@2.0.1"
|
||||
},
|
||||
"npm:inherits@2.0.1": {
|
||||
"util": "github:jspm/nodelibs-util@0.1.0"
|
||||
},
|
||||
"npm:miller-rabin@2.0.1": {
|
||||
"bn.js": "npm:bn.js@2.0.5",
|
||||
"brorand": "npm:brorand@1.0.5"
|
||||
},
|
||||
"npm:parse-asn1@3.0.1": {
|
||||
"asn1.js": "npm:asn1.js@2.0.4",
|
||||
"browserify-aes": "npm:browserify-aes@1.0.1",
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"create-hash": "npm:create-hash@1.1.1",
|
||||
"pbkdf2": "npm:pbkdf2@3.0.4",
|
||||
"systemjs-json": "github:systemjs/plugin-json@0.1.0"
|
||||
},
|
||||
"npm:path-browserify@0.0.0": {
|
||||
"process": "github:jspm/nodelibs-process@0.1.1"
|
||||
},
|
||||
"npm:pbkdf2@3.0.4": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"child_process": "github:jspm/nodelibs-child_process@0.1.0",
|
||||
"create-hmac": "npm:create-hmac@1.1.3",
|
||||
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
|
||||
"path": "github:jspm/nodelibs-path@0.1.0",
|
||||
"process": "github:jspm/nodelibs-process@0.1.1",
|
||||
"systemjs-json": "github:systemjs/plugin-json@0.1.0"
|
||||
},
|
||||
"npm:public-encrypt@2.0.1": {
|
||||
"bn.js": "npm:bn.js@2.0.5",
|
||||
"browserify-rsa": "npm:browserify-rsa@2.0.1",
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"create-hash": "npm:create-hash@1.1.1",
|
||||
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
|
||||
"parse-asn1": "npm:parse-asn1@3.0.1",
|
||||
"randombytes": "npm:randombytes@2.0.1"
|
||||
},
|
||||
"npm:punycode@1.3.2": {
|
||||
"process": "github:jspm/nodelibs-process@0.1.1"
|
||||
},
|
||||
"npm:randombytes@2.0.1": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"crypto": "github:jspm/nodelibs-crypto@0.1.0",
|
||||
"process": "github:jspm/nodelibs-process@0.1.1"
|
||||
},
|
||||
"npm:readable-stream@1.1.13": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"core-util-is": "npm:core-util-is@1.0.1",
|
||||
"events": "github:jspm/nodelibs-events@0.1.1",
|
||||
"inherits": "npm:inherits@2.0.1",
|
||||
"isarray": "npm:isarray@0.0.1",
|
||||
"process": "github:jspm/nodelibs-process@0.1.1",
|
||||
"stream": "github:jspm/nodelibs-stream@0.1.0",
|
||||
"stream-browserify": "npm:stream-browserify@1.0.0",
|
||||
"string_decoder": "npm:string_decoder@0.10.31",
|
||||
"util": "github:jspm/nodelibs-util@0.1.0"
|
||||
},
|
||||
"npm:reflect-metadata@0.1.0": {
|
||||
"assert": "github:jspm/nodelibs-assert@0.1.0",
|
||||
"crypto": "github:jspm/nodelibs-crypto@0.1.0"
|
||||
},
|
||||
"npm:ripemd160@1.0.1": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"process": "github:jspm/nodelibs-process@0.1.1"
|
||||
},
|
||||
"npm:rx@2.5.1": {
|
||||
"process": "github:jspm/nodelibs-process@0.1.1"
|
||||
},
|
||||
"npm:rx@2.5.3": {
|
||||
"process": "github:jspm/nodelibs-process@0.1.1"
|
||||
},
|
||||
"npm:sha.js@2.4.2": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
|
||||
"fs": "github:jspm/nodelibs-fs@0.1.2",
|
||||
"inherits": "npm:inherits@2.0.1",
|
||||
"process": "github:jspm/nodelibs-process@0.1.1"
|
||||
},
|
||||
"npm:stream-browserify@1.0.0": {
|
||||
"events": "github:jspm/nodelibs-events@0.1.1",
|
||||
"inherits": "npm:inherits@2.0.1",
|
||||
"readable-stream": "npm:readable-stream@1.1.13"
|
||||
},
|
||||
"npm:string_decoder@0.10.31": {
|
||||
"buffer": "github:jspm/nodelibs-buffer@0.1.0"
|
||||
},
|
||||
"npm:url@0.10.3": {
|
||||
"assert": "github:jspm/nodelibs-assert@0.1.0",
|
||||
"punycode": "npm:punycode@1.3.2",
|
||||
"querystring": "npm:querystring@0.2.0",
|
||||
"util": "github:jspm/nodelibs-util@0.1.0"
|
||||
},
|
||||
"npm:util@0.10.3": {
|
||||
"inherits": "npm:inherits@2.0.1",
|
||||
"process": "github:jspm/nodelibs-process@0.1.1"
|
||||
},
|
||||
"npm:vm-browserify@0.0.4": {
|
||||
"indexof": "npm:indexof@0.0.1"
|
||||
},
|
||||
"npm:zone.js@0.5.1": {
|
||||
"process": "github:jspm/nodelibs-process@0.1.1"
|
||||
}
|
||||
"babel": "npm:babel-core@5.6.5",
|
||||
"traceur": "github:jmcriffey/bower-traceur@0.0.88",
|
||||
"traceur-runtime": "github:jmcriffey/bower-traceur-runtime@0.0.88"
|
||||
}
|
||||
});
|
||||
|
||||
|
38
gulpfile.js
38
gulpfile.js
@ -29,7 +29,7 @@ gulp.task('clean.build', function() {
|
||||
runSequence(
|
||||
'clean',
|
||||
'transpile',
|
||||
'bundle.deps',
|
||||
//'bundle.deps',
|
||||
'bundle.js',
|
||||
'examples',
|
||||
'sass',
|
||||
@ -131,24 +131,24 @@ gulp.task('bundle.js', function() {
|
||||
.pipe(gulp.dest('dist/js/'));
|
||||
});
|
||||
|
||||
gulp.task('bundle.deps', function() {
|
||||
var Builder = require('systemjs-builder')
|
||||
var builder = new Builder();
|
||||
return builder.loadConfig('config.js').then(function(){
|
||||
// add ionic and angular2 build paths, since config.js is loaded at runtime from
|
||||
// tests we don't want to put them there
|
||||
builder.config({
|
||||
baseURL: 'file:' + process.cwd(),
|
||||
paths : {
|
||||
"ionic/*": "dist/js/es6/ionic/*.js"
|
||||
}
|
||||
});
|
||||
return builder.build('dist/js/es6/ionic/**/* - [dist/js/es6/ionic/**/*]', 'dist/js/dependencies.js');
|
||||
}, function(error){
|
||||
console.log("Error building dependency bundle, have you transpiled Ionic and/or built Angular2 yet?");
|
||||
throw new Error(error);
|
||||
})
|
||||
});
|
||||
//gulp.task('bundle.deps', function() {
|
||||
// var Builder = require('systemjs-builder')
|
||||
// var builder = new Builder();
|
||||
// return builder.loadConfig('config.js').then(function(){
|
||||
// // add ionic and angular2 build paths, since config.js is loaded at runtime from
|
||||
// // tests we don't want to put them there
|
||||
// builder.config({
|
||||
// baseURL: 'file:' + process.cwd(),
|
||||
// paths : {
|
||||
// "ionic/*": "dist/js/es6/ionic/*.js"
|
||||
// }
|
||||
// });
|
||||
// return builder.build('dist/js/es6/ionic/**/* - [dist/js/es6/ionic/**/*]', 'dist/js/dependencies.js');
|
||||
// }, function(error){
|
||||
// console.log("Error building dependency bundle, have you transpiled Ionic and/or built Angular2 yet?");
|
||||
// throw new Error(error);
|
||||
// })
|
||||
//});
|
||||
|
||||
gulp.task('examples', function() {
|
||||
var buildTest = lazypipe()
|
||||
|
10
package.json
10
package.json
@ -40,15 +40,9 @@
|
||||
},
|
||||
"jspm": {
|
||||
"directories": {},
|
||||
"dependencies": {
|
||||
"angular2": "npm:angular2@^2.0.0-alpha.27",
|
||||
"babel-core": "npm:babel-core@^5.4.7",
|
||||
"rx": "npm:rx@^2.5.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel": "npm:babel-core@^5.1.13",
|
||||
"babel-runtime": "npm:babel-runtime@^5.1.13",
|
||||
"core-js": "npm:core-js@^0.9.4"
|
||||
"traceur": "github:jmcriffey/bower-traceur@0.0.88",
|
||||
"traceur-runtime": "github:jmcriffey/bower-traceur-runtime@0.0.88"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -39,14 +39,9 @@
|
||||
<ion-loading-icon></ion-loading-icon>
|
||||
</ion-app>
|
||||
|
||||
<!-- angular2 dependencies -->
|
||||
<script src="/scripts/resources/traceur-runtime.js" type="text/javascript"></script>
|
||||
<script src="/scripts/resources/Reflect.js" type="text/javascript"></script>
|
||||
<script src="/scripts/resources/system.src.js"></script>
|
||||
<!-- SystemJS Loader -->
|
||||
<script src="/jspm_packages/system.src.js"></script>
|
||||
<script src="/config.js"></script>
|
||||
<script src="/dist/js/dependencies.js"></script>
|
||||
<script src="/scripts/resources/zone-microtask.js" type="text/javascript"></script>
|
||||
<script src="/scripts/resources/long-stack-trace-zone.js" type="text/javascript"></script>
|
||||
|
||||
<!-- ionic bundle -->
|
||||
<script src="/dist/js/ionic.bundle.js"></script>
|
||||
|
@ -1,964 +0,0 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (C) Microsoft. All rights reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||||
this file except in compliance with the License. You may obtain a copy of the
|
||||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
***************************************************************************** */
|
||||
"use strict";
|
||||
var Reflect;
|
||||
(function (Reflect) {
|
||||
// Load global or shim versions of Map, Set, and WeakMap
|
||||
var functionPrototype = Object.getPrototypeOf(Function);
|
||||
var _Map = typeof Map === "function" ? Map : CreateMapPolyfill();
|
||||
var _Set = typeof Set === "function" ? Set : CreateSetPolyfill();
|
||||
var _WeakMap = typeof WeakMap === "function" ? WeakMap : CreateWeakMapPolyfill();
|
||||
// [[Metadata]] internal slot
|
||||
var __Metadata__ = new _WeakMap();
|
||||
/**
|
||||
* Applies a set of decorators to a property of a target object.
|
||||
* @param decorators An array of decorators.
|
||||
* @param target The target object.
|
||||
* @param targetKey (Optional) The property key to decorate.
|
||||
* @param targetDescriptor (Optional) The property descriptor for the target key
|
||||
* @remarks Decorators are applied in reverse order.
|
||||
* @example
|
||||
*
|
||||
* class C {
|
||||
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
||||
* // static staticProperty;
|
||||
* // property;
|
||||
*
|
||||
* constructor(p) { }
|
||||
* static staticMethod(p) { }
|
||||
* method(p) { }
|
||||
* }
|
||||
*
|
||||
* // constructor
|
||||
* C = Reflect.decorate(decoratorsArray, C);
|
||||
*
|
||||
* // property (on constructor)
|
||||
* Reflect.decorate(decoratorsArray, C, "staticProperty");
|
||||
*
|
||||
* // property (on prototype)
|
||||
* Reflect.decorate(decoratorsArray, C.prototype, "property");
|
||||
*
|
||||
* // method (on constructor)
|
||||
* Object.defineProperty(C, "staticMethod",
|
||||
* Reflect.decorate(decoratorsArray, C, "staticMethod",
|
||||
* Object.getOwnPropertyDescriptor(C, "staticMethod")));
|
||||
*
|
||||
* // method (on prototype)
|
||||
* Object.defineProperty(C.prototype, "method",
|
||||
* Reflect.decorate(decoratorsArray, C.prototype, "method",
|
||||
* Object.getOwnPropertyDescriptor(C.prototype, "method")));
|
||||
*
|
||||
*/
|
||||
function decorate(decorators, target, targetKey, targetDescriptor) {
|
||||
if (!IsUndefined(targetDescriptor)) {
|
||||
if (!IsArray(decorators)) {
|
||||
throw new TypeError();
|
||||
}
|
||||
else if (!IsObject(target)) {
|
||||
throw new TypeError();
|
||||
}
|
||||
else if (IsUndefined(targetKey)) {
|
||||
throw new TypeError();
|
||||
}
|
||||
else if (!IsObject(targetDescriptor)) {
|
||||
throw new TypeError();
|
||||
}
|
||||
targetKey = ToPropertyKey(targetKey);
|
||||
return DecoratePropertyWithDescriptor(decorators, target, targetKey, targetDescriptor);
|
||||
}
|
||||
else if (!IsUndefined(targetKey)) {
|
||||
if (!IsArray(decorators)) {
|
||||
throw new TypeError();
|
||||
}
|
||||
else if (!IsObject(target)) {
|
||||
throw new TypeError();
|
||||
}
|
||||
targetKey = ToPropertyKey(targetKey);
|
||||
return DecoratePropertyWithoutDescriptor(decorators, target, targetKey);
|
||||
}
|
||||
else {
|
||||
if (!IsArray(decorators)) {
|
||||
throw new TypeError();
|
||||
}
|
||||
else if (!IsConstructor(target)) {
|
||||
throw new TypeError();
|
||||
}
|
||||
return DecorateConstructor(decorators, target);
|
||||
}
|
||||
}
|
||||
Reflect.decorate = decorate;
|
||||
/**
|
||||
* A default metadata decorator factory that can be used on a class, class member, or parameter.
|
||||
* @param metadataKey The key for the metadata entry.
|
||||
* @param metadataValue The value for the metadata entry.
|
||||
* @returns A decorator function.
|
||||
* @remarks
|
||||
* If `metadataKey` is already defined for the target and target key, the
|
||||
* metadataValue for that key will be overwritten.
|
||||
* @example
|
||||
*
|
||||
* // constructor
|
||||
* @Reflect.metadata(key, value)
|
||||
* class C {
|
||||
* }
|
||||
*
|
||||
* // property (on constructor, TypeScript only)
|
||||
* class C {
|
||||
* @Reflect.metadata(key, value)
|
||||
* static staticProperty;
|
||||
* }
|
||||
*
|
||||
* // property (on prototype, TypeScript only)
|
||||
* class C {
|
||||
* @Reflect.metadata(key, value)
|
||||
* property;
|
||||
* }
|
||||
*
|
||||
* // method (on constructor)
|
||||
* class C {
|
||||
* @Reflect.metadata(key, value)
|
||||
* static staticMethod() { }
|
||||
* }
|
||||
*
|
||||
* // method (on prototype)
|
||||
* class C {
|
||||
* @Reflect.metadata(key, value)
|
||||
* method() { }
|
||||
* }
|
||||
*
|
||||
*/
|
||||
function metadata(metadataKey, metadataValue) {
|
||||
function decorator(target, targetKey) {
|
||||
if (!IsUndefined(targetKey)) {
|
||||
if (!IsObject(target)) {
|
||||
throw new TypeError();
|
||||
}
|
||||
targetKey = ToPropertyKey(targetKey);
|
||||
OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, targetKey);
|
||||
}
|
||||
else {
|
||||
if (!IsConstructor(target)) {
|
||||
throw new TypeError();
|
||||
}
|
||||
OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, undefined);
|
||||
}
|
||||
}
|
||||
return decorator;
|
||||
}
|
||||
Reflect.metadata = metadata;
|
||||
/**
|
||||
* Define a unique metadata entry on the target.
|
||||
* @param metadataKey A key used to store and retrieve metadata.
|
||||
* @param metadataValue A value that contains attached metadata.
|
||||
* @param target The target object on which to define metadata.
|
||||
* @param targetKey (Optional) The property key for the target.
|
||||
* @example
|
||||
*
|
||||
* class C {
|
||||
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
||||
* // static staticProperty;
|
||||
* // property;
|
||||
*
|
||||
* constructor(p) { }
|
||||
* static staticMethod(p) { }
|
||||
* method(p) { }
|
||||
* }
|
||||
*
|
||||
* // constructor
|
||||
* Reflect.defineMetadata("custom:annotation", options, C);
|
||||
*
|
||||
* // property (on constructor)
|
||||
* Reflect.defineMetadata("custom:annotation", options, C, "staticProperty");
|
||||
*
|
||||
* // property (on prototype)
|
||||
* Reflect.defineMetadata("custom:annotation", options, C.prototype, "property");
|
||||
*
|
||||
* // method (on constructor)
|
||||
* Reflect.defineMetadata("custom:annotation", options, C, "staticMethod");
|
||||
*
|
||||
* // method (on prototype)
|
||||
* Reflect.defineMetadata("custom:annotation", options, C.prototype, "method");
|
||||
*
|
||||
* // decorator factory as metadata-producing annotation.
|
||||
* function MyAnnotation(options): Decorator {
|
||||
* return (target, key?) => Reflect.defineMetadata("custom:annotation", options, target, key);
|
||||
* }
|
||||
*
|
||||
*/
|
||||
function defineMetadata(metadataKey, metadataValue, target, targetKey) {
|
||||
if (!IsObject(target)) {
|
||||
throw new TypeError();
|
||||
}
|
||||
else if (!IsUndefined(targetKey)) {
|
||||
targetKey = ToPropertyKey(targetKey);
|
||||
}
|
||||
return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, targetKey);
|
||||
}
|
||||
Reflect.defineMetadata = defineMetadata;
|
||||
/**
|
||||
* Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.
|
||||
* @param metadataKey A key used to store and retrieve metadata.
|
||||
* @param target The target object on which the metadata is defined.
|
||||
* @param targetKey (Optional) The property key for the target.
|
||||
* @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.
|
||||
* @example
|
||||
*
|
||||
* class C {
|
||||
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
||||
* // static staticProperty;
|
||||
* // property;
|
||||
*
|
||||
* constructor(p) { }
|
||||
* static staticMethod(p) { }
|
||||
* method(p) { }
|
||||
* }
|
||||
*
|
||||
* // constructor
|
||||
* result = Reflect.hasMetadata("custom:annotation", C);
|
||||
*
|
||||
* // property (on constructor)
|
||||
* result = Reflect.hasMetadata("custom:annotation", C, "staticProperty");
|
||||
*
|
||||
* // property (on prototype)
|
||||
* result = Reflect.hasMetadata("custom:annotation", C.prototype, "property");
|
||||
*
|
||||
* // method (on constructor)
|
||||
* result = Reflect.hasMetadata("custom:annotation", C, "staticMethod");
|
||||
*
|
||||
* // method (on prototype)
|
||||
* result = Reflect.hasMetadata("custom:annotation", C.prototype, "method");
|
||||
*
|
||||
*/
|
||||
function hasMetadata(metadataKey, target, targetKey) {
|
||||
if (!IsObject(target)) {
|
||||
throw new TypeError();
|
||||
}
|
||||
else if (!IsUndefined(targetKey)) {
|
||||
targetKey = ToPropertyKey(targetKey);
|
||||
}
|
||||
return OrdinaryHasMetadata(metadataKey, target, targetKey);
|
||||
}
|
||||
Reflect.hasMetadata = hasMetadata;
|
||||
/**
|
||||
* Gets a value indicating whether the target object has the provided metadata key defined.
|
||||
* @param metadataKey A key used to store and retrieve metadata.
|
||||
* @param target The target object on which the metadata is defined.
|
||||
* @param targetKey (Optional) The property key for the target.
|
||||
* @returns `true` if the metadata key was defined on the target object; otherwise, `false`.
|
||||
* @example
|
||||
*
|
||||
* class C {
|
||||
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
||||
* // static staticProperty;
|
||||
* // property;
|
||||
*
|
||||
* constructor(p) { }
|
||||
* static staticMethod(p) { }
|
||||
* method(p) { }
|
||||
* }
|
||||
*
|
||||
* // constructor
|
||||
* result = Reflect.hasOwnMetadata("custom:annotation", C);
|
||||
*
|
||||
* // property (on constructor)
|
||||
* result = Reflect.hasOwnMetadata("custom:annotation", C, "staticProperty");
|
||||
*
|
||||
* // property (on prototype)
|
||||
* result = Reflect.hasOwnMetadata("custom:annotation", C.prototype, "property");
|
||||
*
|
||||
* // method (on constructor)
|
||||
* result = Reflect.hasOwnMetadata("custom:annotation", C, "staticMethod");
|
||||
*
|
||||
* // method (on prototype)
|
||||
* result = Reflect.hasOwnMetadata("custom:annotation", C.prototype, "method");
|
||||
*
|
||||
*/
|
||||
function hasOwnMetadata(metadataKey, target, targetKey) {
|
||||
if (!IsObject(target)) {
|
||||
throw new TypeError();
|
||||
}
|
||||
else if (!IsUndefined(targetKey)) {
|
||||
targetKey = ToPropertyKey(targetKey);
|
||||
}
|
||||
return OrdinaryHasOwnMetadata(metadataKey, target, targetKey);
|
||||
}
|
||||
Reflect.hasOwnMetadata = hasOwnMetadata;
|
||||
/**
|
||||
* Gets the metadata value for the provided metadata key on the target object or its prototype chain.
|
||||
* @param metadataKey A key used to store and retrieve metadata.
|
||||
* @param target The target object on which the metadata is defined.
|
||||
* @param targetKey (Optional) The property key for the target.
|
||||
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
|
||||
* @example
|
||||
*
|
||||
* class C {
|
||||
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
||||
* // static staticProperty;
|
||||
* // property;
|
||||
*
|
||||
* constructor(p) { }
|
||||
* static staticMethod(p) { }
|
||||
* method(p) { }
|
||||
* }
|
||||
*
|
||||
* // constructor
|
||||
* result = Reflect.getMetadata("custom:annotation", C);
|
||||
*
|
||||
* // property (on constructor)
|
||||
* result = Reflect.getMetadata("custom:annotation", C, "staticProperty");
|
||||
*
|
||||
* // property (on prototype)
|
||||
* result = Reflect.getMetadata("custom:annotation", C.prototype, "property");
|
||||
*
|
||||
* // method (on constructor)
|
||||
* result = Reflect.getMetadata("custom:annotation", C, "staticMethod");
|
||||
*
|
||||
* // method (on prototype)
|
||||
* result = Reflect.getMetadata("custom:annotation", C.prototype, "method");
|
||||
*
|
||||
*/
|
||||
function getMetadata(metadataKey, target, targetKey) {
|
||||
if (!IsObject(target)) {
|
||||
throw new TypeError();
|
||||
}
|
||||
else if (!IsUndefined(targetKey)) {
|
||||
targetKey = ToPropertyKey(targetKey);
|
||||
}
|
||||
return OrdinaryGetMetadata(metadataKey, target, targetKey);
|
||||
}
|
||||
Reflect.getMetadata = getMetadata;
|
||||
/**
|
||||
* Gets the metadata value for the provided metadata key on the target object.
|
||||
* @param metadataKey A key used to store and retrieve metadata.
|
||||
* @param target The target object on which the metadata is defined.
|
||||
* @param targetKey (Optional) The property key for the target.
|
||||
* @returns The metadata value for the metadata key if found; otherwise, `undefined`.
|
||||
* @example
|
||||
*
|
||||
* class C {
|
||||
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
||||
* // static staticProperty;
|
||||
* // property;
|
||||
*
|
||||
* constructor(p) { }
|
||||
* static staticMethod(p) { }
|
||||
* method(p) { }
|
||||
* }
|
||||
*
|
||||
* // constructor
|
||||
* result = Reflect.getOwnMetadata("custom:annotation", C);
|
||||
*
|
||||
* // property (on constructor)
|
||||
* result = Reflect.getOwnMetadata("custom:annotation", C, "staticProperty");
|
||||
*
|
||||
* // property (on prototype)
|
||||
* result = Reflect.getOwnMetadata("custom:annotation", C.prototype, "property");
|
||||
*
|
||||
* // method (on constructor)
|
||||
* result = Reflect.getOwnMetadata("custom:annotation", C, "staticMethod");
|
||||
*
|
||||
* // method (on prototype)
|
||||
* result = Reflect.getOwnMetadata("custom:annotation", C.prototype, "method");
|
||||
*
|
||||
*/
|
||||
function getOwnMetadata(metadataKey, target, targetKey) {
|
||||
if (!IsObject(target)) {
|
||||
throw new TypeError();
|
||||
}
|
||||
else if (!IsUndefined(targetKey)) {
|
||||
targetKey = ToPropertyKey(targetKey);
|
||||
}
|
||||
return OrdinaryGetOwnMetadata(metadataKey, target, targetKey);
|
||||
}
|
||||
Reflect.getOwnMetadata = getOwnMetadata;
|
||||
/**
|
||||
* Gets the metadata keys defined on the target object or its prototype chain.
|
||||
* @param target The target object on which the metadata is defined.
|
||||
* @param targetKey (Optional) The property key for the target.
|
||||
* @returns An array of unique metadata keys.
|
||||
* @example
|
||||
*
|
||||
* class C {
|
||||
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
||||
* // static staticProperty;
|
||||
* // property;
|
||||
*
|
||||
* constructor(p) { }
|
||||
* static staticMethod(p) { }
|
||||
* method(p) { }
|
||||
* }
|
||||
*
|
||||
* // constructor
|
||||
* result = Reflect.getMetadataKeys(C);
|
||||
*
|
||||
* // property (on constructor)
|
||||
* result = Reflect.getMetadataKeys(C, "staticProperty");
|
||||
*
|
||||
* // property (on prototype)
|
||||
* result = Reflect.getMetadataKeys(C.prototype, "property");
|
||||
*
|
||||
* // method (on constructor)
|
||||
* result = Reflect.getMetadataKeys(C, "staticMethod");
|
||||
*
|
||||
* // method (on prototype)
|
||||
* result = Reflect.getMetadataKeys(C.prototype, "method");
|
||||
*
|
||||
*/
|
||||
function getMetadataKeys(target, targetKey) {
|
||||
if (!IsObject(target)) {
|
||||
throw new TypeError();
|
||||
}
|
||||
else if (!IsUndefined(targetKey)) {
|
||||
targetKey = ToPropertyKey(targetKey);
|
||||
}
|
||||
return OrdinaryMetadataKeys(target, targetKey);
|
||||
}
|
||||
Reflect.getMetadataKeys = getMetadataKeys;
|
||||
/**
|
||||
* Gets the unique metadata keys defined on the target object.
|
||||
* @param target The target object on which the metadata is defined.
|
||||
* @param targetKey (Optional) The property key for the target.
|
||||
* @returns An array of unique metadata keys.
|
||||
* @example
|
||||
*
|
||||
* class C {
|
||||
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
||||
* // static staticProperty;
|
||||
* // property;
|
||||
*
|
||||
* constructor(p) { }
|
||||
* static staticMethod(p) { }
|
||||
* method(p) { }
|
||||
* }
|
||||
*
|
||||
* // constructor
|
||||
* result = Reflect.getOwnMetadataKeys(C);
|
||||
*
|
||||
* // property (on constructor)
|
||||
* result = Reflect.getOwnMetadataKeys(C, "staticProperty");
|
||||
*
|
||||
* // property (on prototype)
|
||||
* result = Reflect.getOwnMetadataKeys(C.prototype, "property");
|
||||
*
|
||||
* // method (on constructor)
|
||||
* result = Reflect.getOwnMetadataKeys(C, "staticMethod");
|
||||
*
|
||||
* // method (on prototype)
|
||||
* result = Reflect.getOwnMetadataKeys(C.prototype, "method");
|
||||
*
|
||||
*/
|
||||
function getOwnMetadataKeys(target, targetKey) {
|
||||
if (!IsObject(target)) {
|
||||
throw new TypeError();
|
||||
}
|
||||
else if (!IsUndefined(targetKey)) {
|
||||
targetKey = ToPropertyKey(targetKey);
|
||||
}
|
||||
return OrdinaryOwnMetadataKeys(target, targetKey);
|
||||
}
|
||||
Reflect.getOwnMetadataKeys = getOwnMetadataKeys;
|
||||
/**
|
||||
* Deletes the metadata entry from the target object with the provided key.
|
||||
* @param metadataKey A key used to store and retrieve metadata.
|
||||
* @param target The target object on which the metadata is defined.
|
||||
* @param targetKey (Optional) The property key for the target.
|
||||
* @returns `true` if the metadata entry was found and deleted; otherwise, false.
|
||||
* @example
|
||||
*
|
||||
* class C {
|
||||
* // property declarations are not part of ES6, though they are valid in TypeScript:
|
||||
* // static staticProperty;
|
||||
* // property;
|
||||
*
|
||||
* constructor(p) { }
|
||||
* static staticMethod(p) { }
|
||||
* method(p) { }
|
||||
* }
|
||||
*
|
||||
* // constructor
|
||||
* result = Reflect.deleteMetadata("custom:annotation", C);
|
||||
*
|
||||
* // property (on constructor)
|
||||
* result = Reflect.deleteMetadata("custom:annotation", C, "staticProperty");
|
||||
*
|
||||
* // property (on prototype)
|
||||
* result = Reflect.deleteMetadata("custom:annotation", C.prototype, "property");
|
||||
*
|
||||
* // method (on constructor)
|
||||
* result = Reflect.deleteMetadata("custom:annotation", C, "staticMethod");
|
||||
*
|
||||
* // method (on prototype)
|
||||
* result = Reflect.deleteMetadata("custom:annotation", C.prototype, "method");
|
||||
*
|
||||
*/
|
||||
function deleteMetadata(metadataKey, target, targetKey) {
|
||||
if (!IsObject(target)) {
|
||||
throw new TypeError();
|
||||
}
|
||||
else if (!IsUndefined(targetKey)) {
|
||||
targetKey = ToPropertyKey(targetKey);
|
||||
}
|
||||
// https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#deletemetadata-metadatakey-p-
|
||||
var metadataMap = GetOrCreateMetadataMap(target, targetKey, false);
|
||||
if (IsUndefined(metadataMap)) {
|
||||
return false;
|
||||
}
|
||||
if (!metadataMap.delete(metadataKey)) {
|
||||
return false;
|
||||
}
|
||||
if (metadataMap.size > 0) {
|
||||
return true;
|
||||
}
|
||||
var targetMetadata = __Metadata__.get(target);
|
||||
targetMetadata.delete(targetKey);
|
||||
if (targetMetadata.size > 0) {
|
||||
return true;
|
||||
}
|
||||
__Metadata__.delete(target);
|
||||
return true;
|
||||
}
|
||||
Reflect.deleteMetadata = deleteMetadata;
|
||||
function DecorateConstructor(decorators, target) {
|
||||
for (var i = decorators.length - 1; i >= 0; --i) {
|
||||
var decorator = decorators[i];
|
||||
var decorated = decorator(target);
|
||||
if (!IsUndefined(decorated)) {
|
||||
if (!IsConstructor(decorated)) {
|
||||
throw new TypeError();
|
||||
}
|
||||
target = decorated;
|
||||
}
|
||||
}
|
||||
return target;
|
||||
}
|
||||
function DecoratePropertyWithDescriptor(decorators, target, propertyKey, descriptor) {
|
||||
for (var i = decorators.length - 1; i >= 0; --i) {
|
||||
var decorator = decorators[i];
|
||||
var decorated = decorator(target, propertyKey, descriptor);
|
||||
if (!IsUndefined(decorated)) {
|
||||
if (!IsObject(decorated)) {
|
||||
throw new TypeError();
|
||||
}
|
||||
descriptor = decorated;
|
||||
}
|
||||
}
|
||||
return descriptor;
|
||||
}
|
||||
function DecoratePropertyWithoutDescriptor(decorators, target, propertyKey) {
|
||||
for (var i = decorators.length - 1; i >= 0; --i) {
|
||||
var decorator = decorators[i];
|
||||
decorator(target, propertyKey);
|
||||
}
|
||||
}
|
||||
// https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#getorcreatemetadatamap--o-p-create-
|
||||
function GetOrCreateMetadataMap(target, targetKey, create) {
|
||||
var targetMetadata = __Metadata__.get(target);
|
||||
if (!targetMetadata) {
|
||||
if (!create) {
|
||||
return undefined;
|
||||
}
|
||||
targetMetadata = new _Map();
|
||||
__Metadata__.set(target, targetMetadata);
|
||||
}
|
||||
var keyMetadata = targetMetadata.get(targetKey);
|
||||
if (!keyMetadata) {
|
||||
if (!create) {
|
||||
return undefined;
|
||||
}
|
||||
keyMetadata = new _Map();
|
||||
targetMetadata.set(targetKey, keyMetadata);
|
||||
}
|
||||
return keyMetadata;
|
||||
}
|
||||
// https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryhasmetadata--metadatakey-o-p-
|
||||
function OrdinaryHasMetadata(MetadataKey, O, P) {
|
||||
var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);
|
||||
if (hasOwn) {
|
||||
return true;
|
||||
}
|
||||
var parent = GetPrototypeOf(O);
|
||||
if (parent !== null) {
|
||||
return OrdinaryHasMetadata(MetadataKey, parent, P);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryhasownmetadata--metadatakey-o-p-
|
||||
function OrdinaryHasOwnMetadata(MetadataKey, O, P) {
|
||||
var metadataMap = GetOrCreateMetadataMap(O, P, false);
|
||||
if (metadataMap === undefined) {
|
||||
return false;
|
||||
}
|
||||
return Boolean(metadataMap.has(MetadataKey));
|
||||
}
|
||||
// https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarygetmetadata--metadatakey-o-p-
|
||||
function OrdinaryGetMetadata(MetadataKey, O, P) {
|
||||
var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);
|
||||
if (hasOwn) {
|
||||
return OrdinaryGetOwnMetadata(MetadataKey, O, P);
|
||||
}
|
||||
var parent = GetPrototypeOf(O);
|
||||
if (parent !== null) {
|
||||
return OrdinaryGetMetadata(MetadataKey, parent, P);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
// https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarygetownmetadata--metadatakey-o-p-
|
||||
function OrdinaryGetOwnMetadata(MetadataKey, O, P) {
|
||||
var metadataMap = GetOrCreateMetadataMap(O, P, false);
|
||||
if (metadataMap === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
return metadataMap.get(MetadataKey);
|
||||
}
|
||||
// https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarydefineownmetadata--metadatakey-metadatavalue-o-p-
|
||||
function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {
|
||||
var metadataMap = GetOrCreateMetadataMap(O, P, true);
|
||||
metadataMap.set(MetadataKey, MetadataValue);
|
||||
}
|
||||
// https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinarymetadatakeys--o-p-
|
||||
function OrdinaryMetadataKeys(O, P) {
|
||||
var ownKeys = OrdinaryOwnMetadataKeys(O, P);
|
||||
var parent = GetPrototypeOf(O);
|
||||
if (parent === null) {
|
||||
return ownKeys;
|
||||
}
|
||||
var parentKeys = OrdinaryMetadataKeys(parent, P);
|
||||
if (parentKeys.length <= 0) {
|
||||
return ownKeys;
|
||||
}
|
||||
if (ownKeys.length <= 0) {
|
||||
return parentKeys;
|
||||
}
|
||||
var set = new _Set();
|
||||
var keys = [];
|
||||
for (var _i = 0; _i < ownKeys.length; _i++) {
|
||||
var key = ownKeys[_i];
|
||||
var hasKey = set.has(key);
|
||||
if (!hasKey) {
|
||||
set.add(key);
|
||||
keys.push(key);
|
||||
}
|
||||
}
|
||||
for (var _a = 0; _a < parentKeys.length; _a++) {
|
||||
var key = parentKeys[_a];
|
||||
var hasKey = set.has(key);
|
||||
if (!hasKey) {
|
||||
set.add(key);
|
||||
keys.push(key);
|
||||
}
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
// https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#ordinaryownmetadatakeys--o-p-
|
||||
function OrdinaryOwnMetadataKeys(target, targetKey) {
|
||||
var metadataMap = GetOrCreateMetadataMap(target, targetKey, false);
|
||||
var keys = [];
|
||||
if (metadataMap) {
|
||||
metadataMap.forEach(function (_, key) { return keys.push(key); });
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-language-types-undefined-type
|
||||
function IsUndefined(x) {
|
||||
return x === undefined;
|
||||
}
|
||||
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isarray
|
||||
function IsArray(x) {
|
||||
return Array.isArray(x);
|
||||
}
|
||||
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object-type
|
||||
function IsObject(x) {
|
||||
return typeof x === "object" ? x !== null : typeof x === "function";
|
||||
}
|
||||
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isconstructor
|
||||
function IsConstructor(x) {
|
||||
return typeof x === "function";
|
||||
}
|
||||
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-language-types-symbol-type
|
||||
function IsSymbol(x) {
|
||||
return typeof x === "symbol";
|
||||
}
|
||||
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-topropertykey
|
||||
function ToPropertyKey(value) {
|
||||
if (IsSymbol(value)) {
|
||||
return value;
|
||||
}
|
||||
return String(value);
|
||||
}
|
||||
function GetPrototypeOf(O) {
|
||||
var proto = Object.getPrototypeOf(O);
|
||||
if (typeof O !== "function" || O === functionPrototype) {
|
||||
return proto;
|
||||
}
|
||||
// TypeScript doesn't set __proto__ in ES5, as it's non-standard.
|
||||
// Try to determine the superclass constructor. Compatible implementations
|
||||
// must either set __proto__ on a subclass constructor to the superclass constructor,
|
||||
// or ensure each class has a valid `constructor` property on its prototype that
|
||||
// points back to the constructor.
|
||||
// If this is not the same as Function.[[Prototype]], then this is definately inherited.
|
||||
// This is the case when in ES6 or when using __proto__ in a compatible browser.
|
||||
if (proto !== functionPrototype) {
|
||||
return proto;
|
||||
}
|
||||
// If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.
|
||||
var prototype = O.prototype;
|
||||
var prototypeProto = Object.getPrototypeOf(prototype);
|
||||
if (prototypeProto == null || prototypeProto === Object.prototype) {
|
||||
return proto;
|
||||
}
|
||||
// if the constructor was not a function, then we cannot determine the heritage.
|
||||
var constructor = prototypeProto.constructor;
|
||||
if (typeof constructor !== "function") {
|
||||
return proto;
|
||||
}
|
||||
// if we have some kind of self-reference, then we cannot determine the heritage.
|
||||
if (constructor === O) {
|
||||
return proto;
|
||||
}
|
||||
// we have a pretty good guess at the heritage.
|
||||
return constructor;
|
||||
}
|
||||
// naive Map shim
|
||||
function CreateMapPolyfill() {
|
||||
var cacheSentinel = {};
|
||||
function Map() {
|
||||
this._keys = [];
|
||||
this._values = [];
|
||||
this._cache = cacheSentinel;
|
||||
}
|
||||
Map.prototype = {
|
||||
get size() {
|
||||
return this._keys.length;
|
||||
},
|
||||
has: function (key) {
|
||||
if (key === this._cache) {
|
||||
return true;
|
||||
}
|
||||
if (this._find(key) >= 0) {
|
||||
this._cache = key;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
get: function (key) {
|
||||
var index = this._find(key);
|
||||
if (index >= 0) {
|
||||
this._cache = key;
|
||||
return this._values[index];
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
set: function (key, value) {
|
||||
this.delete(key);
|
||||
this._keys.push(key);
|
||||
this._values.push(value);
|
||||
this._cache = key;
|
||||
return this;
|
||||
},
|
||||
delete: function (key) {
|
||||
var index = this._find(key);
|
||||
if (index >= 0) {
|
||||
this._keys.splice(index, 1);
|
||||
this._values.splice(index, 1);
|
||||
this._cache = cacheSentinel;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
clear: function () {
|
||||
this._keys.length = 0;
|
||||
this._values.length = 0;
|
||||
this._cache = cacheSentinel;
|
||||
},
|
||||
forEach: function (callback, thisArg) {
|
||||
var size = this.size;
|
||||
for (var i = 0; i < size; ++i) {
|
||||
var key = this._keys[i];
|
||||
var value = this._values[i];
|
||||
this._cache = key;
|
||||
callback.call(this, value, key, this);
|
||||
}
|
||||
},
|
||||
_find: function (key) {
|
||||
var keys = this._keys;
|
||||
var size = keys.length;
|
||||
for (var i = 0; i < size; ++i) {
|
||||
if (keys[i] === key) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
return Map;
|
||||
}
|
||||
// naive Set shim
|
||||
function CreateSetPolyfill() {
|
||||
var cacheSentinel = {};
|
||||
function Set() {
|
||||
this._map = new _Map();
|
||||
}
|
||||
Set.prototype = {
|
||||
get size() {
|
||||
return this._map.length;
|
||||
},
|
||||
has: function (value) {
|
||||
return this._map.has(value);
|
||||
},
|
||||
add: function (value) {
|
||||
this._map.set(value, value);
|
||||
return this;
|
||||
},
|
||||
delete: function (value) {
|
||||
return this._map.delete(value);
|
||||
},
|
||||
clear: function () {
|
||||
this._map.clear();
|
||||
},
|
||||
forEach: function (callback, thisArg) {
|
||||
this._map.forEach(callback, thisArg);
|
||||
}
|
||||
};
|
||||
return Set;
|
||||
}
|
||||
// naive WeakMap shim
|
||||
function CreateWeakMapPolyfill() {
|
||||
var UUID_SIZE = 16;
|
||||
var isNode = typeof global !== "undefined" &&
|
||||
typeof module === "object" &&
|
||||
typeof module.exports === "object" &&
|
||||
typeof require === "function";
|
||||
var nodeCrypto = isNode && require("crypto");
|
||||
var hasOwn = Object.prototype.hasOwnProperty;
|
||||
var keys = {};
|
||||
var rootKey = CreateUniqueKey();
|
||||
function WeakMap() {
|
||||
this._key = CreateUniqueKey();
|
||||
}
|
||||
WeakMap.prototype = {
|
||||
has: function (target) {
|
||||
var table = GetOrCreateWeakMapTable(target, false);
|
||||
if (table) {
|
||||
return this._key in table;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
get: function (target) {
|
||||
var table = GetOrCreateWeakMapTable(target, false);
|
||||
if (table) {
|
||||
return table[this._key];
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
set: function (target, value) {
|
||||
var table = GetOrCreateWeakMapTable(target, true);
|
||||
table[this._key] = value;
|
||||
return this;
|
||||
},
|
||||
delete: function (target) {
|
||||
var table = GetOrCreateWeakMapTable(target, false);
|
||||
if (table && this._key in table) {
|
||||
return delete table[this._key];
|
||||
}
|
||||
return false;
|
||||
},
|
||||
clear: function () {
|
||||
// NOTE: not a real clear, just makes the previous data unreachable
|
||||
this._key = CreateUniqueKey();
|
||||
}
|
||||
};
|
||||
function FillRandomBytes(buffer, size) {
|
||||
for (var i = 0; i < size; ++i) {
|
||||
buffer[i] = Math.random() * 255 | 0;
|
||||
}
|
||||
}
|
||||
function GenRandomBytes(size) {
|
||||
if (nodeCrypto) {
|
||||
var data = nodeCrypto.randomBytes(size);
|
||||
return data;
|
||||
}
|
||||
else if (typeof Uint8Array === "function") {
|
||||
var data = new Uint8Array(size);
|
||||
if (typeof crypto !== "undefined") {
|
||||
crypto.getRandomValues(data);
|
||||
}
|
||||
else if (typeof msCrypto !== "undefined") {
|
||||
msCrypto.getRandomValues(data);
|
||||
}
|
||||
else {
|
||||
FillRandomBytes(data, size);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
else {
|
||||
var data = new Array(size);
|
||||
FillRandomBytes(data, size);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
function CreateUUID() {
|
||||
var data = GenRandomBytes(UUID_SIZE);
|
||||
// mark as random - RFC 4122 § 4.4
|
||||
data[6] = data[6] & 0x4f | 0x40;
|
||||
data[8] = data[8] & 0xbf | 0x80;
|
||||
var result = "";
|
||||
for (var offset = 0; offset < UUID_SIZE; ++offset) {
|
||||
var byte = data[offset];
|
||||
if (offset === 4 || offset === 6 || offset === 8) {
|
||||
result += "-";
|
||||
}
|
||||
if (byte < 16) {
|
||||
result += "0";
|
||||
}
|
||||
result += byte.toString(16).toLowerCase();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function CreateUniqueKey() {
|
||||
var key;
|
||||
do {
|
||||
key = "@@WeakMap@@" + CreateUUID();
|
||||
} while (hasOwn.call(keys, key));
|
||||
keys[key] = true;
|
||||
return key;
|
||||
}
|
||||
function GetOrCreateWeakMapTable(target, create) {
|
||||
if (!hasOwn.call(target, rootKey)) {
|
||||
if (!create) {
|
||||
return undefined;
|
||||
}
|
||||
Object.defineProperty(target, rootKey, { value: Object.create(null) });
|
||||
}
|
||||
return target[rootKey];
|
||||
}
|
||||
return WeakMap;
|
||||
}
|
||||
// hook global Reflect
|
||||
(function (__global) {
|
||||
if (typeof __global.Reflect !== "undefined") {
|
||||
if (__global.Reflect !== Reflect) {
|
||||
for (var p in Reflect) {
|
||||
__global.Reflect[p] = Reflect[p];
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
__global.Reflect = Reflect;
|
||||
}
|
||||
})(typeof window !== "undefined" ? window :
|
||||
typeof WorkerGlobalScope !== "undefined" ? self :
|
||||
typeof global !== "undefined" ? global :
|
||||
Function("return this;")());
|
||||
})(Reflect || (Reflect = {}));
|
||||
//# sourceMappingURL=Reflect.js.map
|
27998
scripts/resources/angular2.dev.js
Normal file
27998
scripts/resources/angular2.dev.js
Normal file
File diff suppressed because it is too large
Load Diff
27890
scripts/resources/angular2.js
vendored
Normal file
27890
scripts/resources/angular2.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,401 +0,0 @@
|
||||
(function (global) {
|
||||
var babelHelpers = global.babelHelpers = {};
|
||||
|
||||
babelHelpers.inherits = function (subClass, superClass) {
|
||||
if (typeof superClass !== "function" && superClass !== null) {
|
||||
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
|
||||
}
|
||||
|
||||
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
||||
constructor: {
|
||||
value: subClass,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
if (superClass) subClass.__proto__ = superClass;
|
||||
};
|
||||
|
||||
babelHelpers.defaults = function (obj, defaults) {
|
||||
var keys = Object.getOwnPropertyNames(defaults);
|
||||
|
||||
for (var i = 0; i < keys.length; i++) {
|
||||
var key = keys[i];
|
||||
var value = Object.getOwnPropertyDescriptor(defaults, key);
|
||||
|
||||
if (value && value.configurable && obj[key] === undefined) {
|
||||
Object.defineProperty(obj, key, value);
|
||||
}
|
||||
}
|
||||
|
||||
return obj;
|
||||
};
|
||||
|
||||
babelHelpers.createClass = (function () {
|
||||
function defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
var descriptor = props[i];
|
||||
descriptor.enumerable = descriptor.enumerable || false;
|
||||
descriptor.configurable = true;
|
||||
if ("value" in descriptor) descriptor.writable = true;
|
||||
Object.defineProperty(target, descriptor.key, descriptor);
|
||||
}
|
||||
}
|
||||
|
||||
return function (Constructor, protoProps, staticProps) {
|
||||
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) defineProperties(Constructor, staticProps);
|
||||
return Constructor;
|
||||
};
|
||||
})();
|
||||
|
||||
babelHelpers.createDecoratedClass = (function () {
|
||||
function defineProperties(target, descriptors, initializers) {
|
||||
for (var i = 0; i < descriptors.length; i++) {
|
||||
var descriptor = descriptors[i];
|
||||
var decorators = descriptor.decorators;
|
||||
var key = descriptor.key;
|
||||
delete descriptor.key;
|
||||
delete descriptor.decorators;
|
||||
descriptor.enumerable = descriptor.enumerable || false;
|
||||
descriptor.configurable = true;
|
||||
if ("value" in descriptor || descriptor.initializer) descriptor.writable = true;
|
||||
|
||||
if (decorators) {
|
||||
for (var f = 0; f < decorators.length; f++) {
|
||||
var decorator = decorators[f];
|
||||
|
||||
if (typeof decorator === "function") {
|
||||
descriptor = decorator(target, key, descriptor) || descriptor;
|
||||
} else {
|
||||
throw new TypeError("The decorator for method " + descriptor.key + " is of the invalid type " + typeof decorator);
|
||||
}
|
||||
}
|
||||
|
||||
if (descriptor.initializer !== undefined) {
|
||||
initializers[key] = descriptor;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
Object.defineProperty(target, key, descriptor);
|
||||
}
|
||||
}
|
||||
|
||||
return function (Constructor, protoProps, staticProps, protoInitializers, staticInitializers) {
|
||||
if (protoProps) defineProperties(Constructor.prototype, protoProps, protoInitializers);
|
||||
if (staticProps) defineProperties(Constructor, staticProps, staticInitializers);
|
||||
return Constructor;
|
||||
};
|
||||
})();
|
||||
|
||||
babelHelpers.createDecoratedObject = function (descriptors) {
|
||||
var target = {};
|
||||
|
||||
for (var i = 0; i < descriptors.length; i++) {
|
||||
var descriptor = descriptors[i];
|
||||
var decorators = descriptor.decorators;
|
||||
var key = descriptor.key;
|
||||
delete descriptor.key;
|
||||
delete descriptor.decorators;
|
||||
descriptor.enumerable = true;
|
||||
descriptor.configurable = true;
|
||||
descriptor.writable = true;
|
||||
|
||||
if (decorators) {
|
||||
for (var f = 0; f < decorators.length; f++) {
|
||||
var decorator = decorators[f];
|
||||
|
||||
if (typeof decorator === "function") {
|
||||
descriptor = decorator(target, key, descriptor) || descriptor;
|
||||
} else {
|
||||
throw new TypeError("The decorator for method " + descriptor.key + " is of the invalid type " + typeof decorator);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (descriptor.initializer) {
|
||||
descriptor.value = descriptor.initializer.call(target);
|
||||
}
|
||||
|
||||
Object.defineProperty(target, key, descriptor);
|
||||
}
|
||||
|
||||
return target;
|
||||
};
|
||||
|
||||
babelHelpers.defineDecoratedPropertyDescriptor = function (target, key, descriptors) {
|
||||
var _descriptor = descriptors[key];
|
||||
if (!_descriptor) return;
|
||||
var descriptor = {};
|
||||
|
||||
for (var _key in _descriptor) descriptor[_key] = _descriptor[_key];
|
||||
|
||||
descriptor.value = descriptor.initializer.call(target);
|
||||
Object.defineProperty(target, key, descriptor);
|
||||
};
|
||||
|
||||
babelHelpers.taggedTemplateLiteral = function (strings, raw) {
|
||||
return Object.freeze(Object.defineProperties(strings, {
|
||||
raw: {
|
||||
value: Object.freeze(raw)
|
||||
}
|
||||
}));
|
||||
};
|
||||
|
||||
babelHelpers.taggedTemplateLiteralLoose = function (strings, raw) {
|
||||
strings.raw = raw;
|
||||
return strings;
|
||||
};
|
||||
|
||||
babelHelpers.toArray = function (arr) {
|
||||
return Array.isArray(arr) ? arr : Array.from(arr);
|
||||
};
|
||||
|
||||
babelHelpers.toConsumableArray = function (arr) {
|
||||
if (Array.isArray(arr)) {
|
||||
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
|
||||
|
||||
return arr2;
|
||||
} else {
|
||||
return Array.from(arr);
|
||||
}
|
||||
};
|
||||
|
||||
babelHelpers.slicedToArray = function (arr, i) {
|
||||
if (Array.isArray(arr)) {
|
||||
return arr;
|
||||
} else if (Symbol.iterator in Object(arr)) {
|
||||
var _arr = [];
|
||||
var _n = true;
|
||||
var _d = false;
|
||||
var _e = undefined;
|
||||
|
||||
try {
|
||||
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
||||
_arr.push(_s.value);
|
||||
|
||||
if (i && _arr.length === i) break;
|
||||
}
|
||||
} catch (err) {
|
||||
_d = true;
|
||||
_e = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_n && _i["return"]) _i["return"]();
|
||||
} finally {
|
||||
if (_d) throw _e;
|
||||
}
|
||||
}
|
||||
|
||||
return _arr;
|
||||
} else {
|
||||
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
||||
}
|
||||
};
|
||||
|
||||
babelHelpers.slicedToArrayLoose = function (arr, i) {
|
||||
if (Array.isArray(arr)) {
|
||||
return arr;
|
||||
} else if (Symbol.iterator in Object(arr)) {
|
||||
var _arr = [];
|
||||
|
||||
for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {
|
||||
_arr.push(_step.value);
|
||||
|
||||
if (i && _arr.length === i) break;
|
||||
}
|
||||
|
||||
return _arr;
|
||||
} else {
|
||||
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
||||
}
|
||||
};
|
||||
|
||||
babelHelpers.objectWithoutProperties = function (obj, keys) {
|
||||
var target = {};
|
||||
|
||||
for (var i in obj) {
|
||||
if (keys.indexOf(i) >= 0) continue;
|
||||
if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
|
||||
target[i] = obj[i];
|
||||
}
|
||||
|
||||
return target;
|
||||
};
|
||||
|
||||
babelHelpers.hasOwn = Object.prototype.hasOwnProperty;
|
||||
babelHelpers.slice = Array.prototype.slice;
|
||||
babelHelpers.bind = Function.prototype.bind;
|
||||
|
||||
babelHelpers.defineProperty = function (obj, key, value) {
|
||||
return Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
};
|
||||
|
||||
babelHelpers.asyncToGenerator = function (fn) {
|
||||
return function () {
|
||||
var gen = fn.apply(this, arguments);
|
||||
return new Promise(function (resolve, reject) {
|
||||
var callNext = step.bind(null, "next");
|
||||
var callThrow = step.bind(null, "throw");
|
||||
|
||||
function step(key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
var value = info.value;
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.done) {
|
||||
resolve(value);
|
||||
} else {
|
||||
Promise.resolve(value).then(callNext, callThrow);
|
||||
}
|
||||
}
|
||||
|
||||
callNext();
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
babelHelpers.interopRequireWildcard = function (obj) {
|
||||
if (obj && obj.__esModule) {
|
||||
return obj;
|
||||
} else {
|
||||
var newObj = {};
|
||||
|
||||
if (obj != null) {
|
||||
for (var key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
|
||||
newObj["default"] = obj;
|
||||
return newObj;
|
||||
}
|
||||
};
|
||||
|
||||
babelHelpers.interopRequireDefault = function (obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
"default": obj
|
||||
};
|
||||
};
|
||||
|
||||
babelHelpers._typeof = function (obj) {
|
||||
return obj && obj.constructor === Symbol ? "symbol" : typeof obj;
|
||||
};
|
||||
|
||||
babelHelpers._extends = Object.assign || function (target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i];
|
||||
|
||||
for (var key in source) {
|
||||
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
||||
target[key] = source[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return target;
|
||||
};
|
||||
|
||||
babelHelpers.get = function get(object, property, receiver) {
|
||||
var desc = Object.getOwnPropertyDescriptor(object, property);
|
||||
|
||||
if (desc === undefined) {
|
||||
var parent = Object.getPrototypeOf(object);
|
||||
|
||||
if (parent === null) {
|
||||
return undefined;
|
||||
} else {
|
||||
return get(parent, property, receiver);
|
||||
}
|
||||
} else if ("value" in desc) {
|
||||
return desc.value;
|
||||
} else {
|
||||
var getter = desc.get;
|
||||
|
||||
if (getter === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return getter.call(receiver);
|
||||
}
|
||||
};
|
||||
|
||||
babelHelpers.set = function set(object, property, value, receiver) {
|
||||
var desc = Object.getOwnPropertyDescriptor(object, property);
|
||||
|
||||
if (desc === undefined) {
|
||||
var parent = Object.getPrototypeOf(object);
|
||||
|
||||
if (parent !== null) {
|
||||
set(parent, property, value, receiver);
|
||||
}
|
||||
} else if ("value" in desc && desc.writable) {
|
||||
desc.value = value;
|
||||
} else {
|
||||
var setter = desc.set;
|
||||
|
||||
if (setter !== undefined) {
|
||||
setter.call(receiver, value);
|
||||
}
|
||||
}
|
||||
|
||||
return value;
|
||||
};
|
||||
|
||||
babelHelpers.classCallCheck = function (instance, Constructor) {
|
||||
if (!(instance instanceof Constructor)) {
|
||||
throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
};
|
||||
|
||||
babelHelpers.objectDestructuringEmpty = function (obj) {
|
||||
if (obj == null) throw new TypeError("Cannot destructure undefined");
|
||||
};
|
||||
|
||||
babelHelpers.temporalUndefined = {};
|
||||
|
||||
babelHelpers.temporalAssertDefined = function (val, name, undef) {
|
||||
if (val === undef) {
|
||||
throw new ReferenceError(name + " is not defined - temporal dead zone");
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
babelHelpers.selfGlobal = typeof global === "undefined" ? self : global;
|
||||
|
||||
babelHelpers.defaultProps = function (defaultProps, props) {
|
||||
if (defaultProps) {
|
||||
for (var propName in defaultProps) {
|
||||
if (typeof props[propName] === "undefined") {
|
||||
props[propName] = defaultProps[propName];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return props;
|
||||
};
|
||||
|
||||
babelHelpers._instanceof = function (left, right) {
|
||||
if (right != null && right[Symbol.hasInstance]) {
|
||||
return right[Symbol.hasInstance](left);
|
||||
} else {
|
||||
return left instanceof right;
|
||||
}
|
||||
};
|
||||
|
||||
babelHelpers.interopRequire = function (obj) {
|
||||
return obj && obj.__esModule ? obj["default"] : obj;
|
||||
};
|
||||
})(typeof global === "undefined" ? self : global);
|
File diff suppressed because one or more lines are too long
@ -1,88 +0,0 @@
|
||||
/*
|
||||
* Wrapped stacktrace
|
||||
*
|
||||
* We need this because in some implementations, constructing a trace is slow
|
||||
* and so we want to defer accessing the trace for as long as possible
|
||||
*/
|
||||
Zone.Stacktrace = function (e) {
|
||||
this._e = e;
|
||||
};
|
||||
Zone.Stacktrace.prototype.get = function () {
|
||||
if (zone.stackFramesFilter) {
|
||||
return this._e.stack.
|
||||
split('\n').
|
||||
filter(zone.stackFramesFilter).
|
||||
join('\n');
|
||||
}
|
||||
return this._e.stack;
|
||||
}
|
||||
|
||||
Zone.getStacktrace = function () {
|
||||
function getStacktraceWithUncaughtError () {
|
||||
return new Zone.Stacktrace(new Error());
|
||||
}
|
||||
|
||||
function getStacktraceWithCaughtError () {
|
||||
try {
|
||||
throw new Error();
|
||||
} catch (e) {
|
||||
return new Zone.Stacktrace(e);
|
||||
}
|
||||
}
|
||||
|
||||
// Some implementations of exception handling don't create a stack trace if the exception
|
||||
// isn't thrown, however it's faster not to actually throw the exception.
|
||||
var stack = getStacktraceWithUncaughtError();
|
||||
if (stack && stack._e.stack) {
|
||||
Zone.getStacktrace = getStacktraceWithUncaughtError;
|
||||
return stack;
|
||||
} else {
|
||||
Zone.getStacktrace = getStacktraceWithCaughtError;
|
||||
return Zone.getStacktrace();
|
||||
}
|
||||
};
|
||||
|
||||
Zone.longStackTraceZone = {
|
||||
getLongStacktrace: function (exception) {
|
||||
var trace = [];
|
||||
var zone = this;
|
||||
if (exception) {
|
||||
if (zone.stackFramesFilter) {
|
||||
trace.push(exception.stack.split('\n').
|
||||
filter(zone.stackFramesFilter).
|
||||
join('\n'));
|
||||
} else {
|
||||
trace.push(exception.stack);
|
||||
}
|
||||
}
|
||||
var now = Date.now();
|
||||
while (zone && zone.constructedAtException) {
|
||||
trace.push(
|
||||
'--- ' + (Date(zone.constructedAtTime)).toString() +
|
||||
' - ' + (now - zone.constructedAtTime) + 'ms ago',
|
||||
zone.constructedAtException.get());
|
||||
zone = zone.parent;
|
||||
}
|
||||
return trace.join('\n');
|
||||
},
|
||||
|
||||
stackFramesFilter: function (line) {
|
||||
return line.indexOf('zone.js') === -1;
|
||||
},
|
||||
|
||||
onError: function (exception) {
|
||||
var reporter = this.reporter || console.log.bind(console);
|
||||
reporter(exception.toString());
|
||||
reporter(this.getLongStacktrace(exception));
|
||||
},
|
||||
|
||||
'$fork': function (parentFork) {
|
||||
return function() {
|
||||
var newZone = parentFork.apply(this, arguments);
|
||||
newZone.constructedAtException = Zone.getStacktrace();
|
||||
newZone.constructedAtTime = Date.now();
|
||||
return newZone;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user