mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-23 17:30:04 -05:00
Fix 8355: Fix emit metadata different between transpile and tsc --isolatedModule (#9232)
* Instead of returning undefined for unknownSymbol return itself * Add Transpile unittest * Wip - Add project tests * Add project tests and baselines * Update existed tests * Add tests for emitting metadata with module targetting system
This commit is contained in:
@@ -46,8 +46,9 @@ var MyClass = (function () {
|
||||
}
|
||||
MyClass = __decorate([
|
||||
someDecorator,
|
||||
__metadata('design:paramtypes', [Object])
|
||||
__metadata('design:paramtypes', [(typeof (_a = typeof db_1.default !== 'undefined' && db_1.default.db) === 'function' && _a) || Object])
|
||||
], MyClass);
|
||||
return MyClass;
|
||||
var _a;
|
||||
}());
|
||||
exports.MyClass = MyClass;
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
main.ts(1,21): error TS2307: Cannot find module 'angular2/core'.
|
||||
|
||||
|
||||
==== main.ts (1 errors) ====
|
||||
import * as ng from "angular2/core";
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'angular2/core'.
|
||||
|
||||
declare function foo(...args: any[]);
|
||||
|
||||
@foo
|
||||
export class MyClass1 {
|
||||
constructor(private _elementRef: ng.ElementRef){}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"scenario": "Emit decorator metadata when commonJS and isolatedModules are on",
|
||||
"projectRoot": "tests/cases/projects/decoratorMetadata/emitDecoratorMetadataCommonJSIsolatedModule",
|
||||
"baselineCheck": true,
|
||||
"runTest": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"main.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"main.js"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
define(["require", "exports", "angular2/core"], function (require, exports, ng) {
|
||||
"use strict";
|
||||
var MyClass1 = (function () {
|
||||
function MyClass1(_elementRef) {
|
||||
this._elementRef = _elementRef;
|
||||
}
|
||||
MyClass1 = __decorate([
|
||||
foo,
|
||||
__metadata('design:paramtypes', [(typeof (_a = typeof ng !== 'undefined' && ng.ElementRef) === 'function' && _a) || Object])
|
||||
], MyClass1);
|
||||
return MyClass1;
|
||||
var _a;
|
||||
}());
|
||||
exports.MyClass1 = MyClass1;
|
||||
});
|
||||
@@ -0,0 +1,14 @@
|
||||
main.ts(1,21): error TS2307: Cannot find module 'angular2/core'.
|
||||
|
||||
|
||||
==== main.ts (1 errors) ====
|
||||
import * as ng from "angular2/core";
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'angular2/core'.
|
||||
|
||||
declare function foo(...args: any[]);
|
||||
|
||||
@foo
|
||||
export class MyClass1 {
|
||||
constructor(private _elementRef: ng.ElementRef){}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"scenario": "Emit decorator metadata when commonJS and isolatedModules are on",
|
||||
"projectRoot": "tests/cases/projects/decoratorMetadata/emitDecoratorMetadataCommonJSIsolatedModule",
|
||||
"baselineCheck": true,
|
||||
"runTest": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"main.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"main.js"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var ng = require("angular2/core");
|
||||
var MyClass1 = (function () {
|
||||
function MyClass1(_elementRef) {
|
||||
this._elementRef = _elementRef;
|
||||
}
|
||||
MyClass1 = __decorate([
|
||||
foo,
|
||||
__metadata('design:paramtypes', [(typeof (_a = typeof ng !== 'undefined' && ng.ElementRef) === 'function' && _a) || Object])
|
||||
], MyClass1);
|
||||
return MyClass1;
|
||||
var _a;
|
||||
}());
|
||||
exports.MyClass1 = MyClass1;
|
||||
@@ -0,0 +1,14 @@
|
||||
main.ts(1,21): error TS2307: Cannot find module 'angular2/core'.
|
||||
|
||||
|
||||
==== main.ts (1 errors) ====
|
||||
import * as ng from "angular2/core";
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'angular2/core'.
|
||||
|
||||
declare function foo(...args: any[]);
|
||||
|
||||
@foo
|
||||
export class MyClass1 {
|
||||
constructor(private _elementRef: ng.ElementRef){}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"scenario": "Emit decorator metadata when commonJS and isolatedModules are on",
|
||||
"projectRoot": "tests/cases/projects/decoratorMetadata/emitDecoratorMetadataCommonJSIsolatedModuleNoResolve",
|
||||
"baselineCheck": true,
|
||||
"runTest": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"main.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"main.js"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
define(["require", "exports", "angular2/core"], function (require, exports, ng) {
|
||||
"use strict";
|
||||
var MyClass1 = (function () {
|
||||
function MyClass1(_elementRef) {
|
||||
this._elementRef = _elementRef;
|
||||
}
|
||||
MyClass1 = __decorate([
|
||||
foo,
|
||||
__metadata('design:paramtypes', [(typeof (_a = typeof ng !== 'undefined' && ng.ElementRef) === 'function' && _a) || Object])
|
||||
], MyClass1);
|
||||
return MyClass1;
|
||||
var _a;
|
||||
}());
|
||||
exports.MyClass1 = MyClass1;
|
||||
});
|
||||
@@ -0,0 +1,14 @@
|
||||
main.ts(1,21): error TS2307: Cannot find module 'angular2/core'.
|
||||
|
||||
|
||||
==== main.ts (1 errors) ====
|
||||
import * as ng from "angular2/core";
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'angular2/core'.
|
||||
|
||||
declare function foo(...args: any[]);
|
||||
|
||||
@foo
|
||||
export class MyClass1 {
|
||||
constructor(private _elementRef: ng.ElementRef){}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"scenario": "Emit decorator metadata when commonJS and isolatedModules are on",
|
||||
"projectRoot": "tests/cases/projects/decoratorMetadata/emitDecoratorMetadataCommonJSIsolatedModuleNoResolve",
|
||||
"baselineCheck": true,
|
||||
"runTest": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"main.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"main.js"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var ng = require("angular2/core");
|
||||
var MyClass1 = (function () {
|
||||
function MyClass1(_elementRef) {
|
||||
this._elementRef = _elementRef;
|
||||
}
|
||||
MyClass1 = __decorate([
|
||||
foo,
|
||||
__metadata('design:paramtypes', [(typeof (_a = typeof ng !== 'undefined' && ng.ElementRef) === 'function' && _a) || Object])
|
||||
], MyClass1);
|
||||
return MyClass1;
|
||||
var _a;
|
||||
}());
|
||||
exports.MyClass1 = MyClass1;
|
||||
@@ -0,0 +1,14 @@
|
||||
main.ts(1,21): error TS2307: Cannot find module 'angular2/core'.
|
||||
|
||||
|
||||
==== main.ts (1 errors) ====
|
||||
import * as ng from "angular2/core";
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'angular2/core'.
|
||||
|
||||
declare function foo(...args: any[]);
|
||||
|
||||
@foo
|
||||
export class MyClass1 {
|
||||
constructor(private _elementRef: ng.ElementRef){}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"scenario": "Emit decorator metadata when commonJS and isolatedModules are on",
|
||||
"projectRoot": "tests/cases/projects/decoratorMetadata/emitDecoratorMetadataSystemJS",
|
||||
"baselineCheck": true,
|
||||
"runTest": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"main.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"main.js"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
define(["require", "exports", "angular2/core"], function (require, exports, ng) {
|
||||
"use strict";
|
||||
var MyClass1 = (function () {
|
||||
function MyClass1(_elementRef) {
|
||||
this._elementRef = _elementRef;
|
||||
}
|
||||
MyClass1 = __decorate([
|
||||
foo,
|
||||
__metadata('design:paramtypes', [(typeof (_a = typeof ng !== 'undefined' && ng.ElementRef) === 'function' && _a) || Object])
|
||||
], MyClass1);
|
||||
return MyClass1;
|
||||
var _a;
|
||||
}());
|
||||
exports.MyClass1 = MyClass1;
|
||||
});
|
||||
@@ -0,0 +1,14 @@
|
||||
main.ts(1,21): error TS2307: Cannot find module 'angular2/core'.
|
||||
|
||||
|
||||
==== main.ts (1 errors) ====
|
||||
import * as ng from "angular2/core";
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'angular2/core'.
|
||||
|
||||
declare function foo(...args: any[]);
|
||||
|
||||
@foo
|
||||
export class MyClass1 {
|
||||
constructor(private _elementRef: ng.ElementRef){}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"scenario": "Emit decorator metadata when commonJS and isolatedModules are on",
|
||||
"projectRoot": "tests/cases/projects/decoratorMetadata/emitDecoratorMetadataSystemJS",
|
||||
"baselineCheck": true,
|
||||
"runTest": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"main.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"main.js"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var ng = require("angular2/core");
|
||||
var MyClass1 = (function () {
|
||||
function MyClass1(_elementRef) {
|
||||
this._elementRef = _elementRef;
|
||||
}
|
||||
MyClass1 = __decorate([
|
||||
foo,
|
||||
__metadata('design:paramtypes', [(typeof (_a = typeof ng !== 'undefined' && ng.ElementRef) === 'function' && _a) || Object])
|
||||
], MyClass1);
|
||||
return MyClass1;
|
||||
var _a;
|
||||
}());
|
||||
exports.MyClass1 = MyClass1;
|
||||
@@ -0,0 +1,14 @@
|
||||
main.ts(1,21): error TS2307: Cannot find module 'angular2/core'.
|
||||
|
||||
|
||||
==== main.ts (1 errors) ====
|
||||
import * as ng from "angular2/core";
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'angular2/core'.
|
||||
|
||||
declare function foo(...args: any[]);
|
||||
|
||||
@foo
|
||||
export class MyClass1 {
|
||||
constructor(private _elementRef: ng.ElementRef){}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"scenario": "Emit decorator metadata when commonJS and isolatedModules are on",
|
||||
"projectRoot": "tests/cases/projects/decoratorMetadata/emitDecoratorMetadataSystemJSIsolatedModule",
|
||||
"baselineCheck": true,
|
||||
"runTest": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"main.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"main.js"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
define(["require", "exports", "angular2/core"], function (require, exports, ng) {
|
||||
"use strict";
|
||||
var MyClass1 = (function () {
|
||||
function MyClass1(_elementRef) {
|
||||
this._elementRef = _elementRef;
|
||||
}
|
||||
MyClass1 = __decorate([
|
||||
foo,
|
||||
__metadata('design:paramtypes', [(typeof (_a = typeof ng !== 'undefined' && ng.ElementRef) === 'function' && _a) || Object])
|
||||
], MyClass1);
|
||||
return MyClass1;
|
||||
var _a;
|
||||
}());
|
||||
exports.MyClass1 = MyClass1;
|
||||
});
|
||||
@@ -0,0 +1,14 @@
|
||||
main.ts(1,21): error TS2307: Cannot find module 'angular2/core'.
|
||||
|
||||
|
||||
==== main.ts (1 errors) ====
|
||||
import * as ng from "angular2/core";
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'angular2/core'.
|
||||
|
||||
declare function foo(...args: any[]);
|
||||
|
||||
@foo
|
||||
export class MyClass1 {
|
||||
constructor(private _elementRef: ng.ElementRef){}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"scenario": "Emit decorator metadata when commonJS and isolatedModules are on",
|
||||
"projectRoot": "tests/cases/projects/decoratorMetadata/emitDecoratorMetadataSystemJSIsolatedModule",
|
||||
"baselineCheck": true,
|
||||
"runTest": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"main.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"main.js"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var ng = require("angular2/core");
|
||||
var MyClass1 = (function () {
|
||||
function MyClass1(_elementRef) {
|
||||
this._elementRef = _elementRef;
|
||||
}
|
||||
MyClass1 = __decorate([
|
||||
foo,
|
||||
__metadata('design:paramtypes', [(typeof (_a = typeof ng !== 'undefined' && ng.ElementRef) === 'function' && _a) || Object])
|
||||
], MyClass1);
|
||||
return MyClass1;
|
||||
var _a;
|
||||
}());
|
||||
exports.MyClass1 = MyClass1;
|
||||
@@ -0,0 +1,14 @@
|
||||
main.ts(1,21): error TS2307: Cannot find module 'angular2/core'.
|
||||
|
||||
|
||||
==== main.ts (1 errors) ====
|
||||
import * as ng from "angular2/core";
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'angular2/core'.
|
||||
|
||||
declare function foo(...args: any[]);
|
||||
|
||||
@foo
|
||||
export class MyClass1 {
|
||||
constructor(private _elementRef: ng.ElementRef){}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"scenario": "Emit decorator metadata when commonJS and isolatedModules are on",
|
||||
"projectRoot": "tests/cases/projects/decoratorMetadata/emitDecoratorMetadataSystemJSIsolatedModuleNoResolve",
|
||||
"baselineCheck": true,
|
||||
"runTest": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"main.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"main.js"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
define(["require", "exports", "angular2/core"], function (require, exports, ng) {
|
||||
"use strict";
|
||||
var MyClass1 = (function () {
|
||||
function MyClass1(_elementRef) {
|
||||
this._elementRef = _elementRef;
|
||||
}
|
||||
MyClass1 = __decorate([
|
||||
foo,
|
||||
__metadata('design:paramtypes', [(typeof (_a = typeof ng !== 'undefined' && ng.ElementRef) === 'function' && _a) || Object])
|
||||
], MyClass1);
|
||||
return MyClass1;
|
||||
var _a;
|
||||
}());
|
||||
exports.MyClass1 = MyClass1;
|
||||
});
|
||||
@@ -0,0 +1,14 @@
|
||||
main.ts(1,21): error TS2307: Cannot find module 'angular2/core'.
|
||||
|
||||
|
||||
==== main.ts (1 errors) ====
|
||||
import * as ng from "angular2/core";
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'angular2/core'.
|
||||
|
||||
declare function foo(...args: any[]);
|
||||
|
||||
@foo
|
||||
export class MyClass1 {
|
||||
constructor(private _elementRef: ng.ElementRef){}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"scenario": "Emit decorator metadata when commonJS and isolatedModules are on",
|
||||
"projectRoot": "tests/cases/projects/decoratorMetadata/emitDecoratorMetadataSystemJSIsolatedModuleNoResolve",
|
||||
"baselineCheck": true,
|
||||
"runTest": true,
|
||||
"resolvedInputFiles": [
|
||||
"lib.d.ts",
|
||||
"main.ts"
|
||||
],
|
||||
"emittedFiles": [
|
||||
"main.js"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var ng = require("angular2/core");
|
||||
var MyClass1 = (function () {
|
||||
function MyClass1(_elementRef) {
|
||||
this._elementRef = _elementRef;
|
||||
}
|
||||
MyClass1 = __decorate([
|
||||
foo,
|
||||
__metadata('design:paramtypes', [(typeof (_a = typeof ng !== 'undefined' && ng.ElementRef) === 'function' && _a) || Object])
|
||||
], MyClass1);
|
||||
return MyClass1;
|
||||
var _a;
|
||||
}());
|
||||
exports.MyClass1 = MyClass1;
|
||||
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var ng = require("angular2/core");
|
||||
var MyClass1 = (function () {
|
||||
function MyClass1(_elementRef) {
|
||||
this._elementRef = _elementRef;
|
||||
}
|
||||
MyClass1 = __decorate([
|
||||
fooexport,
|
||||
__metadata('design:paramtypes', [(typeof (_a = typeof ng !== 'undefined' && ng.ElementRef) === 'function' && _a) || Object])
|
||||
], MyClass1);
|
||||
return MyClass1;
|
||||
var _a;
|
||||
}());
|
||||
//# sourceMappingURL=file.js.map
|
||||
@@ -0,0 +1,35 @@
|
||||
System.register(["angular2/core"], function(exports_1, context_1) {
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var ng;
|
||||
var MyClass1;
|
||||
return {
|
||||
setters:[
|
||||
function (ng_1) {
|
||||
ng = ng_1;
|
||||
}],
|
||||
execute: function() {
|
||||
MyClass1 = (function () {
|
||||
function MyClass1(_elementRef) {
|
||||
this._elementRef = _elementRef;
|
||||
}
|
||||
MyClass1 = __decorate([
|
||||
fooexport,
|
||||
__metadata('design:paramtypes', [(typeof (_a = typeof ng !== 'undefined' && ng.ElementRef) === 'function' && _a) || Object])
|
||||
], MyClass1);
|
||||
return MyClass1;
|
||||
var _a;
|
||||
}());
|
||||
}
|
||||
}
|
||||
});
|
||||
//# sourceMappingURL=file.js.map
|
||||
Reference in New Issue
Block a user