This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 975
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace blocked methods with a proxy object that yields itself, to av… (
#10287) * replace blocked methods with a proxy object that yields itself, to avoid breaking code that expects the feature to be in place * added test case for checking that proxy-based feature blocking works * minor corrections to JS formatting, slight reworking of the ToPrimitive handling code in the proxy * further, extremely minor corrections to JS formatting (" -> ')
- Loading branch information
1 parent
69eee42
commit 0e40245
Showing
3 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<html> | ||
<head> | ||
</head> | ||
<body> | ||
<div id="target"> | ||
proxy blocking being tested | ||
</div> | ||
<script> | ||
(function () { | ||
|
||
var canvas = document.createElement("canvas") | ||
canvas.width = 2000 | ||
canvas.height = 200 | ||
canvas.style.display = "inline" | ||
var gl = canvas.getContext("webgl") | ||
var format = gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT) | ||
|
||
// If blocking is working correctly, format will not be a | ||
// WebGLShaderPrecisionFormat instance, but a proxy instance, that allows | ||
// us to look up any indexes and attributes on the object we want. | ||
// If the proxy based method of blocking is working, then the below | ||
// *will not* throw. | ||
format.comeAlongBort['are you talking to me'].no.mySonIsAlsoNamedBort() | ||
|
||
document.getElementsByTagName('div')[0].innerHTML = 'proxy blocking works' | ||
}()) | ||
</script> | ||
</body> | ||
</html> |