Page MenuHomePhabricator

CLDRPluralRuleParser\Converter calls $this->doOperation() incorrectly
Closed, ResolvedPublic

Description

CLDRPluralRuleParser\Converter calls $this->doOperation() with 2 parameters, but the function definition only has one

				while ( $lastOp && self::$precedence[$token->name] <= self::$precedence[$lastOp->name] ) {
					$this->doOperation( $lastOp, $this->operands );
					array_pop( $this->operators );
					$lastOp = end( $this->operators );
				}
		while ( $op = array_pop( $this->operators ) ) {
			$this->doOperation( $op, $this->operands );
		}
	protected function doOperation( Operator $op ) {
		if ( count( $this->operands ) < 2 ) {
			$op->error( 'missing operand' );
		}
		$right = array_pop( $this->operands );
		$left = array_pop( $this->operands );
		$result = $op->operate( $left, $right );
		$this->operands[] = $result;
	}

Event Timeline

Reedy created this task.Nov 20 2015, 1:22 PM
Reedy assigned this task to Nikerabbit.
Reedy raised the priority of this task from to Needs Triage.
Reedy updated the task description. (Show Details)
Reedy added a project: I18n.
Reedy added a subscriber: Reedy.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptNov 20 2015, 1:22 PM
Nikerabbit triaged this task as Low priority.Nov 21 2015, 9:25 AM

Not introduced in the split to its own package: https://github.com/wikimedia/mediawiki/blame/REL1_26/languages/utils/CLDRPluralRuleConverter.php

Marking as low because there doesn't seem to be any functionality issues caused by this.

Nemo_bis removed Nikerabbit as the assignee of this task.Dec 8 2015, 8:12 PM
Nemo_bis set Security to None.
Haritha28 added a subscriber: Haritha28.
MtDu claimed this task.Jan 12 2016, 2:01 AM
MtDu added a subscriber: MtDu.

I'll fix this.

Change 263571 had a related patch set uploaded (by MtDu):
Call doOperation function correctly in CLDRPluralRuleParser\Converter

https://gerrit.wikimedia.org/r/263571

Change 263571 merged by jenkins-bot:
Call doOperation function correctly in CLDRPluralRuleParser\Converter

https://gerrit.wikimedia.org/r/263571

MtDu closed this task as Resolved.Jan 19 2016, 9:01 PM