/tests/Conformance/15_Native_ECMA_Script_Objects/15.1_The_Global_Object/15.1.3_URI_Handling_Function_Properties/15.1.3.4_encodeURIComponent/S15.1.3.4_A5.2.js

http://sputniktests.googlecode.com/ · JavaScript · 29 lines · 10 code · 8 blank · 11 comment · 3 complexity · 624adf92ba2440c93b6faefc8afe7a25 MD5 · raw file

  1. // Copyright 2009 the Sputnik authors. All rights reserved.
  2. // This code is governed by the BSD license found in the LICENSE file.
  3. /**
  4. * @name: S15.1.3.4_A5.2;
  5. * @section: 15.1.3.4, 15.2.4.5, 11.4.1;
  6. * @assertion: The length property of encodeURIComponent has the attribute DontDelete;
  7. * @description: Checking use hasOwnProperty, delete;
  8. */
  9. //CHECK#1
  10. if (encodeURIComponent.hasOwnProperty('length') !== true) {
  11. $FAIL('#1: encodeURIComponent.hasOwnProperty(\'length\') === true. Actual: ' + (encodeURIComponent.hasOwnProperty('length')));
  12. }
  13. delete encodeURIComponent.length;
  14. //CHECK#2
  15. if (encodeURIComponent.hasOwnProperty('length') !== true) {
  16. $ERROR('#2: delete encodeURIComponent.length; encodeURIComponent.hasOwnProperty(\'length\') === true. Actual: ' + (encodeURIComponent.hasOwnProperty('length')));
  17. }
  18. //CHECK#3
  19. if (encodeURIComponent.length === undefined) {
  20. $ERROR('#3: delete encodeURIComponent.length; encodeURIComponent.length !== undefined');
  21. }