Skip to content

Commit

Permalink
Fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuckton committed Dec 21, 2016
1 parent 166d500 commit bda5e97
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 113 deletions.
200 changes: 99 additions & 101 deletions Reflect.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Reflect.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Reflect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@ namespace Reflect {
const hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);
if (hasOwn) return true;
const parent = OrdinaryGetPrototypeOf(O);
if (!IsNull(parent)) OrdinaryHasMetadata(MetadataKey, parent, P);
if (!IsNull(parent)) return OrdinaryHasMetadata(MetadataKey, parent, P);
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1451,6 +1451,7 @@

<emu-intro id="introduction">
<h1 class="first">Metadata Proposal - ECMAScript<span class="utils"><span class="anchor"><a href="#introduction">link</a></span><span class="anchor"><a href="#" class="utils-pin">pin</a></span></span></h1>
<emu-note><span class="note">Note</span><div class="note-contents">A shim for this API can be found here: <a href="https://github.com/rbuckton/ReflectDecorators">https://github.com/rbuckton/ReflectDecorators</a></div></emu-note>
<p>Proposal to add Metadata to ECMAScript.</p>
</emu-intro>

Expand Down Expand Up @@ -1649,7 +1650,6 @@ <h1><span class="secnum">4</span>Reflection<span class="utils"><span class="anch
<emu-clause id="reflect">
<h1><span class="secnum">4.1</span>The Reflect Object<span class="utils"><span class="anchor"><a href="#reflect">link</a></span><span class="anchor"><a href="#" class="utils-pin">pin</a></span></span></h1>
<p>This section contains amendments to the Reflect object.</p>
<emu-note><span class="note">Note</span><div class="note-contents">A shim for this API can be found here: <a href="https://github.com/rbuckton/ReflectDecorators">https://github.com/rbuckton/ReflectDecorators</a></div></emu-note>
<emu-clause id="reflect-metadatadecoratorfunctions">
<h1><span class="secnum">4.1.1</span>Metadata Decorator Functions<span class="utils"><span class="anchor"><a href="#reflect-metadatadecoratorfunctions">link</a></span><span class="anchor"><a href="#" class="utils-pin">pin</a></span></span></h1>
<p>A metadata decorator function is an anonymous built-in function that has [[MetadataKey]] and [[MetadataValue]] internal slots.</p>
Expand Down
12 changes: 6 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ gulp.task("build:reflect", () => gulp
.pipe(project())
.pipe(gulp.dest(".")));

gulp.task("build:tests", () => gulp
gulp.task("build:tests", ["build:reflect"], () => gulp
.src(["test/**/*.ts"])
.pipe(tests())
.pipe(gulp.dest("test")));
Expand All @@ -33,15 +33,15 @@ gulp.task("build:spec", () => gulp
}))
.pipe(gulp.dest("docs")));

gulp.task("build", ["build:reflect", "build:tests", "build:spec"]);
gulp.task("build", ["build:tests", "build:spec"]);

gulp.task("test", ["build:tests"], () => gulp
.src(["test/**/*.js"], { read: false })
.pipe(mocha()));
.pipe(mocha({ reporter: "dot" })));

gulp.task("watch:reflect", ["test"], () => gulp.watch(["Reflect.ts", "test/**/*"], ["test"]));
gulp.task("watch:spec", ["build:spec"], () => gulp.watch(["spec.html"], ["build:spec"]));
gulp.task("watch", ["test", "watch:reflect", "watch:spec"], () => {
gulp.task("watch:reflect", () => gulp.watch(["Reflect.ts", "tsconfig.json", "test/**/*.ts", "test/**/tsconfig.json"], ["test"]));
gulp.task("watch:spec", () => gulp.watch(["spec.html"], ["build:spec"]));
gulp.task("watch", ["watch:reflect", "watch:spec"], () => {
const server = gls.static("docs", 8080);
const promise = server.start();
gulp.watch(["docs/**/*"], file => server.notify(file));
Expand Down
2 changes: 1 addition & 1 deletion spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

<emu-intro id="introduction">
<h1>Metadata Proposal - ECMAScript</h1>
<emu-note>A shim for this API can be found here: <a href="https://github.com/rbuckton/ReflectDecorators">https://github.com/rbuckton/ReflectDecorators</a></emu-note>
<p>Proposal to add Metadata to ECMAScript.</p>
</emu-intro>

Expand Down Expand Up @@ -313,7 +314,6 @@ <h1>Reflection</h1>
<emu-clause id="reflect">
<h1>The Reflect Object</h1>
<p>This section contains amendments to the Reflect object.</p>
<emu-note>A shim for this API can be found here: <a href="https://github.com/rbuckton/ReflectDecorators">https://github.com/rbuckton/ReflectDecorators</a></emu-note>
<emu-clause id="reflect-metadatadecoratorfunctions">
<h1>Metadata Decorator Functions</h1>
<p>A metadata decorator function is an anonymous built-in function that has [[MetadataKey]] and [[MetadataValue]] internal slots.</p>
Expand Down
4 changes: 2 additions & 2 deletions test/reflect-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ describe("Reflect.metadata", () => {
assert.throws(() => decorator(undefined, "name"), TypeError);
});

it("DecoratorThrowsWithInvalidTargetWithoutTargetKey", () => {
it("DecoratorThrowsWithInvalidTargetKey", () => {
let decorator = Reflect.metadata("key", "value");
assert.throws(() => decorator({}, undefined), TypeError);
assert.throws(() => decorator({}, <any>{}), TypeError);
});

it("OnTargetWithoutTargetKey", () => {
Expand Down

0 comments on commit bda5e97

Please sign in to comment.