Skip to content

Commit

Permalink
Adjust for sync
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbaileyuk committed Feb 29, 2024
1 parent 40ac3ad commit 8dbe6a8
Showing 1 changed file with 15 additions and 18 deletions.
33 changes: 15 additions & 18 deletions test/implementation-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -809,30 +809,27 @@ describe("Tests that are specific to a Javascript runtime", () => {
describe("Expressions that attempt to pollute the object prototype", function() {
it("should throw an error with __proto__", async function() {
const expr = jsonata('{} ~> | __proto__ | {"is_admin": true} |');
expect(
expr.evaluate()
).to.eventually.be.rejected.to.deep.contain({
position: 7,
code: "D1010",
});
expect(function() {
expr.evaluate();
})
.to.throw()
.to.deep.contain({ position: 7, code: "D1010" });
});
it("should throw an error with __lookupGetter__", async function() {
const expr = jsonata('{} ~> | __lookupGetter__("__proto__")() | {"is_admin": true} |');
expect(
expr.evaluate()
).to.eventually.be.rejected.to.deep.contain({
position: 7,
code: "D1010",
});
expect(function() {
expr.evaluate();
})
.to.throw()
.to.deep.contain({ position: 7, code: "D1010" });
});
it("should throw an error with constructor", async function() {
const expr = jsonata('{} ~> | constructor | {"is_admin": true} |');
expect(
expr.evaluate()
).to.eventually.be.rejected.to.deep.contain({
position: 7,
code: "D1010",
});
expect(function() {
expr.evaluate();
})
.to.throw()
.to.deep.contain({ position: 7, code: "D1010" });
});
});
});
Expand Down

0 comments on commit 8dbe6a8

Please sign in to comment.