c2795bd790
Implement https://github.com/tc39/ecma402/pull/500 For the legacy [optional] Unwrap*Format steps, use OrdinaryHasInstance instead of InstanceofOperator. ECMA402 agree w/ PR500 on 2021-1-14 Bug: v8:10981 Change-Id: Ic697aa245b11fecaf998127c009e59a821aaa01e Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2444092 Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Reviewed-by: Shu-yu Guo <syg@chromium.org> Commit-Queue: Frank Tang <ftang@chromium.org> Cr-Commit-Position: refs/heads/master@{#72303}
11 lines
436 B
JavaScript
11 lines
436 B
JavaScript
// Copyright 2018 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.
|
|
|
|
// Make sure passing 1 or false to patched construtor won't cause crash
|
|
|
|
Object.defineProperty(Intl.NumberFormat, Symbol.hasInstance, { value: _ => true });
|
|
assertDoesNotThrow(() => Intl.NumberFormat.call(1));
|
|
|
|
assertDoesNotThrow(() => Intl.NumberFormat.call(false));
|