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

type coercion harness utilities + features flags + linting #1221

Merged
merged 13 commits into from
Sep 11, 2017

Conversation

rwaldron
Copy link
Contributor

@rwaldron rwaldron commented Sep 8, 2017

This builds on #1200 as described in #1215 (comment)

It's likely better to review this one commit at a time:

  1. 65424be
  2. 8a2ec34
  3. c7a5d21
  4. fa61006
  5. e3447b8

@rwaldron rwaldron requested a review from leobalter September 8, 2017 16:48
let ieval = eval;

assert.throws(err, function() { Function(wrappedCode); }, `Function: ${code}`);
assert.throws(err, function() { Function(wrappedCode); }, 'Function: ' + code);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry @leobalter ;)

@@ -20,5 +20,5 @@ function compareArray(a, b) {

assert.compareArray = function(actual, expected, message) {
assert(compareArray(actual, expected),
`Expected [${actual.join(", ")}] and [${expected.join(", ")}] to have the same contents. ${message}`);
'Expected [' + actual.join(', ') + '] and [' + expected.join(', ') + '] to have the same contents. ' + message);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry again @leobalter ;)

Copy link
Member

Choose a reason for hiding this comment

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

Haha

}
}

if (Object.prototype.hasOwnProperty.call(desc, 'configurable')) {
if (desc.configurable !== originalDesc.configurable ||
desc.configurable !== isConfigurable(obj, name)) {
failures.push(`descriptor should ${desc.configurable ? '' : 'not '}be configurable`);
failures.push('descriptor should ' + (desc.configurable ? '' : 'not ') + 'be configurable');
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, @leobalter I'm not really sorry ;)

@rwaldron rwaldron force-pushed the thejoshwolfe-type-coercion branch from b22899a to e294b80 Compare September 8, 2017 17:05
@@ -51,6 +51,7 @@ regexp-unicode-property-escapes

# Shared Memory and atomics
# https://github.com/tc39/ecmascript_sharedmem
Atomics
Copy link
Member

Choose a reason for hiding this comment

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

Does it really make sense to have feature flags for parts of proposals? Atomics is part of the SharedArrayBuffer proposal. Do we expect implementations to do part of a language feature and separate it out this way?

Copy link
Member

Choose a reason for hiding this comment

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

I'm +1 to use a single tag for each proposal, some exceptions can be considered, but in this case I believe it's ok to use the SharedArrayBuffer tag.

Wrt the exceptions, I guess this could possibly apply to private class fields, but we should postpone this discussion to a later time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added Atomics just to be thorough, since it's a new global. Is the consensus here that I should remove?

Copy link
Member

Choose a reason for hiding this comment

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

I'm in favor of using a single name for features from the SharedArrayBuffer proposal. Even though, I believe we can change it as a follow up improvement.

If this is good to land, I don't want to block it, we can have a separate discussion to find an agreement for this specific part later.

@thejoshwolfe
Copy link
Contributor

Is there a reason we're putting the harness/ feature dependencies in an external file features.yml instead of in the harness files themselves? Couldn't the linter just parse the front matter of each dependent harness file for the transitive dependencies?

@littledan
Copy link
Member

@thejoshwolfe The harness files aren't test files, so they won't have the same frontmatter in general. Harness files are included in other files, so different logic is needed here. It might not be the prettiest, but it seems like the current system is a working solution.

@rwaldron
Copy link
Contributor Author

Is there a reason we're putting the harness/ feature dependencies in an external file features.yml instead of in the harness files themselves?

Dan's response is 100%, but I'll add some explanation re: the "frontmatter" that appears in the harness files: it's meaningless. I recently added that information just to keep track of what was in each file, I could've used jsdoc or similar—it wouldn't have made a difference.

@leobalter
Copy link
Member

@thejoshwolfe that's an interesting point, and Dan is correct. The harness files are conceptually replaceable, they only provide an API that is expected by the tests and those can run with anything similar. There are even examples of expected replacements, like $ERROR or API for Detached Array Buffers. The former needs to use the proper output call and Test262 can't use anything to really detach array buffers directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants