浏览代码

Update tests to reflect error message change

David Yang 7 年之前
父节点
当前提交
8688cf795a
共有 3 个文件被更改,包括 6 次插入6 次删除
  1. 4 4
      test/es6/ES6Symbol.js
  2. 1 1
      test/es6module/dynamic-module-import-specifier.js
  3. 1 1
      test/wasm/baselines/api.baseline

+ 4 - 4
test/es6/ES6Symbol.js

@@ -185,14 +185,14 @@ var tests = [
     {
         name: "Symbol primitive toString should throw a type error",
         body: function() {
-            assert.throws(function() { 'string' + Symbol.iterator; }, TypeError, "Symbol primitives throw on implicit string conversion", "Object doesn't support property or method 'ToString'");
+            assert.throws(function() { 'string' + Symbol.iterator; }, TypeError, "Symbol primitives throw on implicit string conversion", "No implicit conversion of Symbol to String");
         }
     },
     {
         name: "String(symbol) behavior",
         body: function() {
             assert.areEqual('Symbol(description)', String(Symbol('description')), "String(Symbol('description')) === 'Symbol(description)'");
-            assert.throws(function () { new String(Symbol('description')); }, TypeError, "Symbol as an argument to new String() throws", "Object doesn't support property or method 'ToString'");
+            assert.throws(function () { new String(Symbol('description')); }, TypeError, "Symbol as an argument to new String() throws", "No implicit conversion of Symbol to String");
         }
     },
     {
@@ -827,8 +827,8 @@ var tests = [
         body: function() {
             var x = Symbol();
 
-            assert.throws(function() { "str" + x; }, TypeError, "Adding a string and a symbol throws TypeError", "Object doesn't support property or method 'ToString'");
-            assert.throws(function() { x + "str"; }, TypeError, "Adding a symbol and a string throws TypeError", "Object doesn't support property or method 'ToString'");
+            assert.throws(function() { "str" + x; }, TypeError, "Adding a string and a symbol throws TypeError", "No implicit conversion of Symbol to String");
+            assert.throws(function() { x + "str"; }, TypeError, "Adding a symbol and a string throws TypeError", "No implicit conversion of Symbol to String");
             assert.throws(function() { 10 + x; }, TypeError, "Adding a number and a symbol throws TypeError", "Number expected");
             assert.throws(function() { x + 10; }, TypeError, "Adding a symbol and a number throws TypeError", "Number expected");
         }

+ 1 - 1
test/es6module/dynamic-module-import-specifier.js

@@ -133,7 +133,7 @@ var tests = [
             testNonStringSpecifier("1/0", "URIError", "Infinity");
             testNonStringSpecifier("1.123456789012345678901", "URIError", "1.1234567890123457");
             testNonStringSpecifier("-1.123456789012345678901", "URIError", "-1.1234567890123457");
-            testNonStringSpecifier('Symbol("abc")', "TypeError", "Object doesn't support property or method 'ToString'");
+            testNonStringSpecifier('Symbol("abc")', "TypeError", "No implicit conversion of Symbol to String");
             testNonStringSpecifier("{}", "URIError", "[object Object]");
         }
     },

+ 1 - 1
test/wasm/baselines/api.baseline

@@ -116,7 +116,7 @@ Test 1 passed. Expected Error: TypeError: WebAssembly.Module expected
 Test 2 passed. Expected Error: TypeError: WebAssembly.Module expected
 Test 3 passed. Expected Error: TypeError: WebAssembly.Module expected
 Test 4 passed. Expected Error: Error: Doesn't support toString
-Test 5 passed. Expected Error: TypeError: Object doesn't support property or method 'ToString'
+Test 5 passed. Expected Error: TypeError: No implicit conversion of Symbol to String
 6/6 tests passed
 
 new WebAssembly.Instance tests