| OLD | NEW | 
|     1 /* |     1 /* | 
|     2  * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. |     2  * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. | 
|     3  * |     3  * | 
|     4  * Redistribution and use in source and binary forms, with or without |     4  * Redistribution and use in source and binary forms, with or without | 
|     5  * modification, are permitted provided that the following conditions are |     5  * modification, are permitted provided that the following conditions are | 
|     6  * met: |     6  * met: | 
|     7  * |     7  * | 
|     8  *     * Redistributions of source code must retain the above copyright |     8  *     * Redistributions of source code must retain the above copyright | 
|     9  * notice, this list of conditions and the following disclaimer. |     9  * notice, this list of conditions and the following disclaimer. | 
|    10  *     * Redistributions in binary form must reproduce the above |    10  *     * Redistributions in binary form must reproduce the above | 
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   658         } |   658         } | 
|   659         // 3. Set i to i+1. |   659         // 3. Set i to i+1. | 
|   660         ++i; |   660         ++i; | 
|   661     } |   661     } | 
|   662  |   662  | 
|   663     // 6. Return U. |   663     // 6. Return U. | 
|   664     ASSERT(u.length() == string.length()); |   664     ASSERT(u.length() == string.length()); | 
|   665     return u.toString(); |   665     return u.toString(); | 
|   666 } |   666 } | 
|   667  |   667  | 
|   668 String toScalarValueString(v8::Handle<v8::Value> value, ExceptionState& exceptio
      nState) |   668 String toUSVString(v8::Handle<v8::Value> value, ExceptionState& exceptionState) | 
|   669 { |   669 { | 
|   670     // From the Encoding standard (with a TODO to move to Web IDL): |   670     // http://heycam.github.io/webidl/#es-USVString | 
|   671     // http://encoding.spec.whatwg.org/#type-scalarvaluestring |  | 
|   672     if (value.IsEmpty()) |   671     if (value.IsEmpty()) | 
|   673         return String(); |   672         return String(); | 
|   674  |   673  | 
|   675     v8::TryCatch block; |   674     v8::TryCatch block; | 
|   676     v8::Local<v8::String> stringObject(value->ToString()); |   675     v8::Local<v8::String> stringObject(value->ToString()); | 
|   677     if (block.HasCaught()) { |   676     if (block.HasCaught()) { | 
|   678         exceptionState.rethrowV8Exception(block.Exception()); |   677         exceptionState.rethrowV8Exception(block.Exception()); | 
|   679         return String(); |   678         return String(); | 
|   680     } |   679     } | 
|   681  |   680  | 
|   682     // ScalarValueString is identical to DOMString except that "convert a |   681     // USVString is identical to DOMString except that "convert a | 
|   683     // DOMString to a sequence of Unicode characters" is used subsequently |   682     // DOMString to a sequence of Unicode characters" is used subsequently | 
|   684     // when converting to an IDL value |   683     // when converting to an IDL value | 
|   685     String x = toCoreString(stringObject); |   684     String x = toCoreString(stringObject); | 
|   686     return replaceUnmatchedSurrogates(x); |   685     return replaceUnmatchedSurrogates(x); | 
|   687 } |   686 } | 
|   688  |   687  | 
|   689 PassRefPtrWillBeRawPtr<XPathNSResolver> toXPathNSResolver(v8::Handle<v8::Value> 
      value, v8::Isolate* isolate) |   688 PassRefPtrWillBeRawPtr<XPathNSResolver> toXPathNSResolver(v8::Handle<v8::Value> 
      value, v8::Isolate* isolate) | 
|   690 { |   689 { | 
|   691     RefPtrWillBeRawPtr<XPathNSResolver> resolver = nullptr; |   690     RefPtrWillBeRawPtr<XPathNSResolver> resolver = nullptr; | 
|   692     if (V8XPathNSResolver::hasInstance(value, isolate)) |   691     if (V8XPathNSResolver::hasInstance(value, isolate)) | 
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   994  |   993  | 
|   995 v8::Local<v8::Value> v8IteratorResult(v8::Isolate* isolate, v8::Handle<v8::Value
      > value) |   994 v8::Local<v8::Value> v8IteratorResult(v8::Isolate* isolate, v8::Handle<v8::Value
      > value) | 
|   996 { |   995 { | 
|   997     v8::Local<v8::Object> result = v8::Object::New(isolate); |   996     v8::Local<v8::Object> result = v8::Object::New(isolate); | 
|   998     result->Set(v8String(isolate, "value"), value); |   997     result->Set(v8String(isolate, "value"), value); | 
|   999     result->Set(v8String(isolate, "done"), v8Boolean(false, isolate)); |   998     result->Set(v8String(isolate, "done"), v8Boolean(false, isolate)); | 
|  1000     return result; |   999     return result; | 
|  1001 } |  1000 } | 
|  1002  |  1001  | 
|  1003 } // namespace blink |  1002 } // namespace blink | 
| OLD | NEW |