Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(836)

Unified Diff: test/mjsunit/regress/regress-319722-ArrayBuffer.js

Issue 110573004: Merge bleeding_edge 17696:18016. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/mjsunit/regress/regress-319722-ArrayBuffer.js
diff --git a/test/mjsunit/stack-traces-custom-lazy.js b/test/mjsunit/regress/regress-319722-ArrayBuffer.js
similarity index 72%
copy from test/mjsunit/stack-traces-custom-lazy.js
copy to test/mjsunit/regress/regress-319722-ArrayBuffer.js
index 91d97f3739dc746434731352a0ec7ade0d839484..1849bd2247a4750336b29e68b41bbb7d6ba2d1af 100644
--- a/test/mjsunit/stack-traces-custom-lazy.js
+++ b/test/mjsunit/regress/regress-319722-ArrayBuffer.js
@@ -25,25 +25,34 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-function testPrepareStackTrace(closure) {
- var error = undefined;
+// Flags: --nostress-opt --allow-natives-syntax --mock-arraybuffer-allocator
+var maxSize = %MaxSmi() + 1;
+var ab;
+
+// Allocate the largest ArrayBuffer we can on this architecture.
+for (k = 8; k >= 1 && ab == null; k = k/2) {
try {
- closure();
- assertUnreachable();
+ ab = new ArrayBuffer(maxSize * k);
} catch (e) {
- error = e;
+ ab = null;
}
+}
- // We expect custom formatting to be lazy. Setting the custom
- // function right before calling error.stack should be fine.
- Error.prepareStackTrace = function(e, frames) {
- return "bar";
- }
+assertTrue(ab != null);
- assertEquals("bar", error.stack);
- Error.prepareStackTrace = undefined;
+function TestArray(constr) {
+ assertThrows(function() {
+ new constr(ab, 0, maxSize);
+ }, RangeError);
}
-testPrepareStackTrace(function() { throw new Error("foo"); });
-testPrepareStackTrace(function f() { f(); });
+TestArray(Uint8Array);
+TestArray(Int8Array);
+TestArray(Uint16Array);
+TestArray(Int16Array);
+TestArray(Uint32Array);
+TestArray(Int32Array);
+TestArray(Float32Array);
+TestArray(Float64Array);
+TestArray(Uint8ClampedArray);

Powered by Google App Engine
This is Rietveld 408576698