(token)
| 34573 | } |
| 34574 | |
| 34575 | onComment(token) { |
| 34576 | const value = token.value; |
| 34577 | (0, (_invariant || _load_invariant()).default)(typeof value === 'string', 'expected token value to be a string'); |
| 34578 | |
| 34579 | const comment = value.trim(); |
| 34580 | |
| 34581 | const versionMatch = comment.match(VERSION_REGEX); |
| 34582 | if (versionMatch) { |
| 34583 | const version = +versionMatch[1]; |
| 34584 | if (version > (_constants || _load_constants()).LOCKFILE_VERSION) { |
| 34585 | throw new (_errors || _load_errors()).MessageError(`Can't install from a lockfile of version ${version} as you're on an old yarn version that only supports ` + `versions up to ${(_constants || _load_constants()).LOCKFILE_VERSION}. Run \`$ yarn self-update\` to upgrade to the latest version.`); |
| 34586 | } |
| 34587 | } |
| 34588 | |
| 34589 | this.comments.push(comment); |
| 34590 | } |
| 34591 | |
| 34592 | next() { |
| 34593 | const item = this.tokens.next(); |
no test coverage detected