Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: test/mjsunit/function-call.js

Issue 9568005: Fix Error.prototype.toString to throw TypeError. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Andreas Rossberg. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/v8natives.js ('k') | test/mjsunit/regress/regress-1980.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 String.prototype.replace, 61 String.prototype.replace,
62 String.prototype.search, 62 String.prototype.search,
63 String.prototype.slice, 63 String.prototype.slice,
64 String.prototype.split, 64 String.prototype.split,
65 String.prototype.substring, 65 String.prototype.substring,
66 String.prototype.toLowerCase, 66 String.prototype.toLowerCase,
67 String.prototype.toLocaleLowerCase, 67 String.prototype.toLocaleLowerCase,
68 String.prototype.toUpperCase, 68 String.prototype.toUpperCase,
69 String.prototype.toLocaleUpperCase, 69 String.prototype.toLocaleUpperCase,
70 String.prototype.trim, 70 String.prototype.trim,
71 Number.prototype.toLocaleString, 71 Number.prototype.toLocaleString];
72 Error.prototype.toString];
73 72
74 // Non generic natives do not work on any input other than the specific 73 // Non generic natives do not work on any input other than the specific
75 // type, but since this change will allow call to be invoked with undefined 74 // type, but since this change will allow call to be invoked with undefined
76 // or null as this we still explicitly test that we throw on these here. 75 // or null as this we still explicitly test that we throw on these here.
77 var non_generic = 76 var non_generic =
78 [Array.prototype.toString, 77 [Array.prototype.toString,
79 Array.prototype.toLocaleString, 78 Array.prototype.toLocaleString,
80 Function.prototype.toString, 79 Function.prototype.toString,
81 Function.prototype.call, 80 Function.prototype.call,
82 Function.prototype.apply, 81 Function.prototype.apply,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 Date.prototype.setUTCDate, 126 Date.prototype.setUTCDate,
128 Date.prototype.setMonth, 127 Date.prototype.setMonth,
129 Date.prototype.setUTCMonth, 128 Date.prototype.setUTCMonth,
130 Date.prototype.setFullYear, 129 Date.prototype.setFullYear,
131 Date.prototype.setUTCFullYear, 130 Date.prototype.setUTCFullYear,
132 Date.prototype.toUTCString, 131 Date.prototype.toUTCString,
133 Date.prototype.toISOString, 132 Date.prototype.toISOString,
134 Date.prototype.toJSON, 133 Date.prototype.toJSON,
135 RegExp.prototype.exec, 134 RegExp.prototype.exec,
136 RegExp.prototype.test, 135 RegExp.prototype.test,
137 RegExp.prototype.toString]; 136 RegExp.prototype.toString,
137 Error.prototype.toString];
138 138
139 139
140 // Mapping functions. 140 // Mapping functions.
141 var mapping_functions = 141 var mapping_functions =
142 [Array.prototype.every, 142 [Array.prototype.every,
143 Array.prototype.some, 143 Array.prototype.some,
144 Array.prototype.forEach, 144 Array.prototype.forEach,
145 Array.prototype.map, 145 Array.prototype.map,
146 Array.prototype.filter]; 146 Array.prototype.filter];
147 147
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 } 350 }
351 } 351 }
352 352
353 353
354 // Object.prototype.toString() 354 // Object.prototype.toString()
355 assertEquals(Object.prototype.toString.call(null), 355 assertEquals(Object.prototype.toString.call(null),
356 '[object Null]') 356 '[object Null]')
357 357
358 assertEquals(Object.prototype.toString.call(undefined), 358 assertEquals(Object.prototype.toString.call(undefined),
359 '[object Undefined]') 359 '[object Undefined]')
OLDNEW
« no previous file with comments | « src/v8natives.js ('k') | test/mjsunit/regress/regress-1980.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698