• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

[BUG] Extendscript problem with sort() method

Enthusiast ,
Oct 09, 2024 Oct 09, 2024

Copy link to clipboard

Copied

AE 2024 & Beta crash when using:

alert(
  [2, 1, 0].sort(function () {
    return Math.random() - 0.5
  })
)

 

demo:

(function(thisObj) {
    buildUI(thisObj);
    function buildUI(thisObj) {
        var palette = (thisObj instanceof Panel) ? thisObj : new Window("palette", "BUG", undefined, {
            resizeable: true
        }
                                                                       );
        var button1 = palette.add("button", undefined, "RUN");
        if (palette instanceof Window) {
            palette.show();
        }
        else {
            palette.layout.layout(true);
        }
        button1.onClick = function() {
            alert([2, 1, 0].sort(function () {
                return Math.random() - 0.5;
            }));
        };
    }
}
)(this);
Bug Unresolved
TOPICS
Crash , Scripting

Views

46

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 Comment
Enthusiast ,
Oct 09, 2024 Oct 09, 2024

Copy link to clipboard

Copied

LATEST

 I found just before the crash it returns:

[2,0,0]

which makes no sense.

screenshot.png

 

 

Votes

Translate

Translate

Report

Report