From d72f4a477c7586d317cc9dc7c1372d67b8f7cece Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Mon, 21 May 2012 14:11:12 +0200 Subject: [PATCH] Implement Array.prototype.sort --- qv4ecmaobjects.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qv4ecmaobjects.cpp b/qv4ecmaobjects.cpp index daee5e9..a6e9239 100644 --- a/qv4ecmaobjects.cpp +++ b/qv4ecmaobjects.cpp @@ -1318,7 +1318,10 @@ void ArrayPrototype::method_slice(Context *ctx) void ArrayPrototype::method_sort(Context *ctx) { Value self = ctx->thisObject; + Value comparefn = ctx->argument(0); if (ArrayObject *instance = self.asArrayObject()) { + instance->value.sort(ctx, comparefn); + ctx->result = ctx->thisObject; } else { assert(!"generic implementation of Array.prototype.sort"); } -- 2.7.4