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

reimplement noncommutative sort #2

Merged
merged 1 commit into from
Nov 20, 2020
Merged

reimplement noncommutative sort #2

merged 1 commit into from
Nov 20, 2020

Conversation

amireh
Copy link

@amireh amireh commented Nov 18, 2020

the workaround for handlebars-lang/handlebars.js/issues/748 employed a sorting
routine that was not commutative; its output relied on the order of its
arguments, and with the V8 engine upgrade in node11, that order has
changed1

the order of the arguments to Array#sory is considered an implementation
detail that we can't rely on

this patch reimplements that sorting routine to always return the same
result regardless of the order of its operands, and so it should work on
node <= 10 and >= 11

test plan: there is already a case for this, so I just added node12 to
the travis language matrix

the workaround for handlebars-lang/handlebars.js/issues/748 employed a sorting
routine that was not commutative; its output relied on the order of its
arguments, and with the V8 engine upgrade in node11, that order has
changed[1]

the order of the arguments to Array#sory is considered an implementation
detail that we can't rely on

this patch reimplements that sorting routine to always return the same
result regardless of the order of its operands, and so it should work on
node <= 10 and >= 11

test plan: there is already a case for this, so I just added node12 to
           the travis language matrix

[1]: nodejs/node#24294
@simonista
Copy link

👍 looks good to me

@amireh amireh merged commit 4bdc1f5 into master Nov 20, 2020
amireh added a commit to instructure/i18nliner-js that referenced this pull request May 24, 2022
refs FOO-1116
flag = none

this pulls in a version of the package that can work under node > 10,
see instructure/i18nliner-handlebars#2

:: test plan

you need to try this in both node 10 and node 12, run webpack when you
switch versions

create a module in a course that has some students and add some stuff
to it, then view its progress and verify the student names show up
fine

Change-Id: I5f5b110b64cc6ffab3dc190785c641c0b3bc5b4a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/253070
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
amireh added a commit to instructure/i18nliner-js that referenced this pull request May 25, 2022
refs FOO-1116
flag = none

this pulls in a version of the package that can work under node > 10,
see instructure/i18nliner-handlebars#2

:: test plan

you need to try this in both node 10 and node 12, run webpack when you
switch versions

create a module in a course that has some students and add some stuff
to it, then view its progress and verify the student names show up
fine

Change-Id: I5f5b110b64cc6ffab3dc190785c641c0b3bc5b4a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/253070
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
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.

2 participants