MCPcopy
hub / github.com/angular-ui/ui-grid / ensureSafeObject

Function ensureSafeObject

lib/test/angular/1.4.3/angular.js:12391–12416  ·  view source on GitHub ↗
(obj, fullExpression)

Source from the content-addressed store, hash-verified

12389}
12390
12391function ensureSafeObject(obj, fullExpression) {
12392 // nifty check if obj is Function that is fast and works across iframes and other contexts
12393 if (obj) {
12394 if (obj.constructor === obj) {
12395 throw $parseMinErr('isecfn',
12396 'Referencing Function in Angular expressions is disallowed! Expression: {0}',
12397 fullExpression);
12398 } else if (// isWindow(obj)
12399 obj.window === obj) {
12400 throw $parseMinErr('isecwindow',
12401 'Referencing the Window in Angular expressions is disallowed! Expression: {0}',
12402 fullExpression);
12403 } else if (// isElement(obj)
12404 obj.children && (obj.nodeName || (obj.prop && obj.attr && obj.find))) {
12405 throw $parseMinErr('isecdom',
12406 'Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}',
12407 fullExpression);
12408 } else if (// block Object so that we can't get hold of dangerous Object.* methods
12409 obj === Object) {
12410 throw $parseMinErr('isecobj',
12411 'Referencing Object in Angular expressions is disallowed! Expression: {0}',
12412 fullExpression);
12413 }
12414 }
12415 return obj;
12416}
12417
12418var CALL = Function.prototype.call;
12419var APPLY = Function.prototype.apply;

Callers 2

angular.jsFile · 0.70
setterFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected