OLD | NEW |
1 // Copyright 2007-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2009 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 v8::HandleScope scope; | 244 v8::HandleScope scope; |
245 | 245 |
246 v8::Handle<v8::Script> script = Compile( | 246 v8::Handle<v8::Script> script = Compile( |
247 "function MyClass() {}\n" | 247 "function MyClass() {}\n" |
248 "MyClass.prototype = {\n" | 248 "MyClass.prototype = {\n" |
249 " method1: 0 ? function() { return 1; } :\n" | 249 " method1: 0 ? function() { return 1; } :\n" |
250 " function() { return 2; } }"); | 250 " function() { return 2; } }"); |
251 CheckFunctionName(script, "return 1", "MyClass.method1"); | 251 CheckFunctionName(script, "return 1", "MyClass.method1"); |
252 CheckFunctionName(script, "return 2", "MyClass.method1"); | 252 CheckFunctionName(script, "return 2", "MyClass.method1"); |
253 } | 253 } |
| 254 |
| 255 |
| 256 // See http://code.google.com/p/v8/issues/detail?id=380 |
| 257 TEST(Issue380) { |
| 258 InitializeVM(); |
| 259 v8::HandleScope scope; |
| 260 |
| 261 v8::Handle<v8::Script> script = Compile( |
| 262 "function a() {\n" |
| 263 "var result = function(p,a,c,k,e,d)" |
| 264 "{return p}(\"if blah blah\",62,1976,\'a|b\'.split(\'|\'),0,{})\n" |
| 265 "}"); |
| 266 CheckFunctionName(script, "return p", ""); |
| 267 } |
OLD | NEW |