Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Commit

Permalink
Child validation: support x:composable-element, not just x:element (
Browse files Browse the repository at this point in the history
#217)

This makes it possible to use these traits for HTML tags etc

Test plan:

```
fredemmott@fredemmott-mm1 xhp-lib % ~/code/hhast/bin/hhast-migrate --add-xhp-children-declaration-method src
fredemmott@fredemmott-mm1 xhp-lib % hh_client
No errors!
fredemmott@fredemmott-mm1 xhp-lib % vendor/bin/hacktest tests
...............................................................................S.SSS.S.S.....................SSSS......SS....

Summary: 125 test(s), 113 passed, 0 failed, 12 skipped, 0 error(s).
fredemmott@fredemmott-mm1 xhp-lib % git diff src | gist  -t patch
https://gist.github.com/6dafcf73169756cc80078d2e765ada2c
```

Tests fail without this change.

That is with hhvm/hhast#268
  • Loading branch information
fredemmott authored Feb 19, 2020
1 parent 83e81a3 commit c5ecd73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/children/XHPChildDeclarationConsistencyValidation.hack
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use namespace \Facebook\XHP\ChildValidation as XHPChild;

/** Verify that a new child declaration matches the legacy codegen. */
trait XHPChildDeclarationConsistencyValidation {
require extends :x:element;
require extends :x:composable-element;

abstract protected static function getChildrenDeclaration(
): XHPChild\Constraint;
Expand Down
2 changes: 1 addition & 1 deletion src/children/XHPChildValidation.hack
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use namespace \Facebook\XHP\ChildValidation as XHPChild;

/** Verify that a new child declaration matches the legacy codegen. */
trait XHPChildValidation {
require extends :x:element;
require extends :x:composable-element;

abstract protected static function getChildrenDeclaration(
): XHPChild\Constraint;
Expand Down

0 comments on commit c5ecd73

Please sign in to comment.