blob: a2cb2e1aaf1ab6df73bd6b07b1d3a2346b358c76 [file] [log] [blame]
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/**
* @assertion ByteBuffer buffer
* Returns the byte buffer associated with this object.
* @description Checks that [buffer] is read-only and can't be set.
* @author msyabro
*/
import "dart:typed_data";
import "../../../Utils/expect.dart";
void check(count) {
dynamic l = new ByteData(count);
try {
l.buffer = new Int8List(count).buffer;
Expect.fail("[buffer] should be read-only");
} on NoSuchMethodError {}
}
main() {
check(0);
check(1);
check(100);
}