Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Conversation

@Ruby184
Copy link
Contributor

@Ruby184 Ruby184 commented Aug 12, 2020

Proposed changes

Refs are not passed to validation function due to incorrect name validator of parameter which is accepted by compiled wrapping function which should be refs:

return async function (root, validations, errorReporter, helpers, validator) {

In validation runtimeOptions refs are referenced and because of name mismatch it is undefined.

return `const ${this.getVariableOptionsName(variableName)} = {
	root,
	refs,
	field: ${field},
	tip: ${tip},
	pointer: ${pointer},${arrayExpressionPointerItem}
	mutate: ${this.getVariableMutationName(variableName)},
	${this.COMPILER_REFERENCES.reportError}
}`

Also I have removed unneeded arguments in compile function because it does not take any arguments - it is called straight away and is returning async function mentioned above where are the arguments names.

I have also added test for arguments passed to compile and validation functions in rule.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have read the CONTRIBUTING doc
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if appropriate)

Further comments

@thetutlage thetutlage merged commit a7b0a02 into adonisjs:develop Aug 12, 2020
@Ruby184 Ruby184 deleted the fix/refs-undefined branch August 12, 2020 08:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants