blob: 2797cc989d733caef80ee3e4b68d42d3a77a7bc2 [file] [log] [blame]
<html>
<head>
<script src="../../../resources/js-test.js"></script>
<script src="resources/webgl-test.js"></script>
<script src="resources/webgl-test-utils.js"></script>
</head>
<body>
<div id="description"></div>
<div id="console"></div>
<script>
description("Verifies that WebGLRenderingContext::getAttachedShaders doesn't crash when an accessor property is defined on Array.prototype.");
if (window.internals)
window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
context = create3DContext();
program = context.createProgram();
shader1 = context.createShader(context.VERTEX_SHADER);
context.attachShader(program, shader1);
for (var i = 0; i < 10; ++i) {
shader2 = context.createShader(context.FRAGMENT_SHADER);
context.attachShader(program, shader2);
Array.prototype.__defineSetter__(0, function() {
context.detachShader(program, shader2);
context.deleteShader(shader2);
shader2 = null;
gc();
});
shaders = context.getAttachedShaders(program);
context.getShaderParameter(shaders[1], 0);
}
</script>
</body>
</html>