Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Verify Property harness #979

Merged
merged 1 commit into from
Apr 15, 2017
Merged

Conversation

leobalter
Copy link
Member

signature:

verifyProperty(
  Object obj,
  String|Symbol name,
  Object|undefined {
    Boolean writable,
    Boolean configurable,
    Boolean enumerable
  },
  Object { Boolean restore }
);

You can set an expliecit restore option if you need to reuse the same property, works well for accessor descriptors too.

I've had to add a monkey patch to $ERROR in tests asserting negative effects, it is ugly, but it works.

cc @littledan;

@@ -11,7 +81,7 @@ function isConfigurable(obj, name) {
}

function isEnumerable(obj, name) {
var stringCheck;
var stringCheck = false;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this undefined value got me into a lot of trouble while writing the tests.

@littledan
Copy link
Member

Seems good to me. I could imagine more features, like value in the options. I also don't know the whole motivation for this approach as opposed to adding restore versions of the individual test functions. But this should be useful for my test.

@leobalter
Copy link
Member Author

Seems good to me. I could imagine more features, like value in the options.

this is for sure one of the goals. I had this in mind when I created this function and I'm planning to follow - in another PR - with support to verify values for data and accessor descriptors.

I also don't know the whole motivation for this approach as opposed to adding restore versions of the individual test functions. But this should be useful for my test.

This solves a lot of other problems we've had with the other individual problems. The calling order for each function was one of the most annoying.

@leobalter leobalter merged commit e43ce56 into tc39:master Apr 15, 2017
@leobalter leobalter deleted the verify-property branch September 21, 2017 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants