OS_5553123.js 911 B

12345678910111213141516171819202122232425262728293031
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js");
  6. function testRelationalComparison (retVal)
  7. {
  8. var ObjectV = function ObjectV(v){ }
  9. ObjectV.prototype = {
  10. valueOf : function(){ return retVal; }
  11. };
  12. function f()
  13. {
  14. var x = new ObjectV(0);
  15. x<"1";
  16. }
  17. f();
  18. f();
  19. f();
  20. }
  21. testRelationalComparison(null);
  22. testRelationalComparison(undefined);
  23. assert.throws(function() { testRelationalComparison(Symbol("abc")); }, TypeError, "Number expected");
  24. WScript.Echo("Passed");