2015-10-20 09:57:01 +00:00
|
|
|
// Copyright 2015 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.
|
|
|
|
|
2016-01-12 06:07:48 +00:00
|
|
|
'use strict';
|
|
|
|
|
2015-10-20 09:57:01 +00:00
|
|
|
var typedArray = new Int8Array(1);
|
|
|
|
var saved;
|
|
|
|
var called;
|
2016-01-12 06:07:48 +00:00
|
|
|
class TypedArraySubclass extends Int8Array {
|
|
|
|
constructor(x) {
|
|
|
|
super(x);
|
|
|
|
called = true;
|
|
|
|
saved = x;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
typedArray.constructor = TypedArraySubclass
|
2015-10-20 09:57:01 +00:00
|
|
|
typedArray.map(function(){});
|
|
|
|
|
2016-01-12 06:07:48 +00:00
|
|
|
assertTrue(called);
|
|
|
|
assertEquals(saved, 1);
|