/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* Set up some typed arrays. */
sb.ab = new ArrayBuffer(8); for (var i = 0; i < 8; ++i) new Uint8Array(sb.ab)[i] = i * 10;
sb.ta = [];
TypedArrays.forEach(f => sb.ta.push(new f(sb.ab)));
sb.dv = new DataView(sb.ab);
/* Things that should throw. */
checkThrows("Object.prototype.__lookupSetter__('__proto__').call(obj, {});", sb);
sb.re = /f/;
checkThrows("RegExp.prototype.exec.call(re, 'abcdefg').index", sb);
sb.d = new Date();
checkThrows("Date.prototype.setYear.call(d, 2011)", sb);
sb.m = new Map();
checkThrows("(new Map()).clear.call(m)", sb);
checkThrows("ArrayBuffer.prototype.__lookupGetter__('byteLength').call(ab);", sb);
checkThrows("ArrayBuffer.prototype.slice.call(ab, 0);", sb);
checkThrows("DataView.prototype.getInt8.call(dv, 0);", sb);
/* Now that Date is on Xrays, these should all throw. */
checkThrows("Date.prototype.getYear.call(d)", sb);
checkThrows("Date.prototype.valueOf.call(d)", sb);
checkThrows("d.valueOf()", sb);
checkThrows("d.toString()", sb);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.