Bones/node_modules/reflect-metadata/temp/test/reflect/reflect-definemetadata.js
SOUTHERNCO\x2mjbyrn 7efe7605b8 Template Upload
2017-05-17 13:45:25 -04:00

17 lines
1.1 KiB
JavaScript

// Reflect.defineMetadata ( metadataKey, metadataValue, target, propertyKey )
// - https://github.com/jonathandturner/decorators/blob/master/specs/metadata.md#reflectdefinemetadata--metadatakey-metadatavalue-target-propertykey-
require("../../Reflect");
var assert = require("assert");
function ReflectDefineMetadataInvalidTarget() {
assert.throws(function () { return Reflect.defineMetadata("key", "value", undefined, undefined); }, TypeError);
}
exports.ReflectDefineMetadataInvalidTarget = ReflectDefineMetadataInvalidTarget;
function ReflectDefineMetadataValidTargetWithoutTargetKey() {
assert.doesNotThrow(function () { return Reflect.defineMetadata("key", "value", {}, undefined); });
}
exports.ReflectDefineMetadataValidTargetWithoutTargetKey = ReflectDefineMetadataValidTargetWithoutTargetKey;
function ReflectDefineMetadataValidTargetWithTargetKey() {
assert.doesNotThrow(function () { return Reflect.defineMetadata("key", "value", {}, "name"); });
}
exports.ReflectDefineMetadataValidTargetWithTargetKey = ReflectDefineMetadataValidTargetWithTargetKey;
//# sourceMappingURL=reflect-definemetadata.js.map