aboutsummaryrefslogtreecommitdiffstats
path: root/test/suite/es6/Array.prototype.find/Array.prototype.find_this-defined.js
blob: 88bf029cde9778f8339aab59c290bf5a811a8363 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Copyright (c) 2014 Matthew Meyers. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
description: thisArg should be bound to this if provided
---*/

var globalThis = this;

[1].find(function () {
    if (this !== Array) {
      $ERROR('#1: this !== Array');
    }
    if (this === globalThis) {
      $ERROR('#2: this === globalThis. Should be Array');
    }
}, Array);