v8/test/intl/regress-4870.js
littledan 29bd8286ee Use stricter type checks in Intl's bound methods
This patch ensures that Intl bound method getters can't be retargeted
to other Intl types. If that were to happen, then a RUNTIME_ASSERT
would trigger later. This patch throws a TypeError instead, as the
specification requires.

BUG=v8:4870

Review-Url: https://codereview.chromium.org/1986763003
Cr-Commit-Position: refs/heads/master@{#36330}
2016-05-18 14:57:58 +00:00

9 lines
329 B
JavaScript

// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
assertThrows(() =>
Object.getOwnPropertyDescriptor(Intl.Collator.prototype, 'compare')
.get.call(new Intl.DateTimeFormat())('a', 'b'),
TypeError);