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

Side by Side Diff: src/extensions/i18n/date-format.js

Issue 18075004: Mark i18n functions as native and set proper names (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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/extensions/i18n/collator.js ('k') | src/extensions/i18n/footer.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 addWECPropertyIfDefined(result, 'weekday', fromPattern.weekday); 370 addWECPropertyIfDefined(result, 'weekday', fromPattern.weekday);
371 addWECPropertyIfDefined(result, 'hour12', fromPattern.hour12); 371 addWECPropertyIfDefined(result, 'hour12', fromPattern.hour12);
372 addWECPropertyIfDefined(result, 'hour', fromPattern.hour); 372 addWECPropertyIfDefined(result, 'hour', fromPattern.hour);
373 addWECPropertyIfDefined(result, 'minute', fromPattern.minute); 373 addWECPropertyIfDefined(result, 'minute', fromPattern.minute);
374 addWECPropertyIfDefined(result, 'second', fromPattern.second); 374 addWECPropertyIfDefined(result, 'second', fromPattern.second);
375 375
376 return result; 376 return result;
377 }, 377 },
378 ATTRIBUTES.DONT_ENUM 378 ATTRIBUTES.DONT_ENUM
379 ); 379 );
380 %FunctionSetName(Intl.DateTimeFormat.prototype.resolvedOptions,
381 'resolvedOptions');
380 %FunctionRemovePrototype(Intl.DateTimeFormat.prototype.resolvedOptions); 382 %FunctionRemovePrototype(Intl.DateTimeFormat.prototype.resolvedOptions);
383 %SetNativeFlag(Intl.DateTimeFormat.prototype.resolvedOptions);
381 384
382 385
383 /** 386 /**
384 * Returns the subset of the given locale list for which this locale list 387 * Returns the subset of the given locale list for which this locale list
385 * has a matching (possibly fallback) locale. Locales appear in the same 388 * has a matching (possibly fallback) locale. Locales appear in the same
386 * order in the returned list as in the input list. 389 * order in the returned list as in the input list.
387 * Options are optional parameter. 390 * Options are optional parameter.
388 */ 391 */
389 %SetProperty(Intl.DateTimeFormat, 'supportedLocalesOf', function(locales) { 392 %SetProperty(Intl.DateTimeFormat, 'supportedLocalesOf', function(locales) {
390 if (%_IsConstructCall()) { 393 if (%_IsConstructCall()) {
391 throw new TypeError(ORDINARY_FUNCTION_CALLED_AS_CONSTRUCTOR); 394 throw new TypeError(ORDINARY_FUNCTION_CALLED_AS_CONSTRUCTOR);
392 } 395 }
393 396
394 return supportedLocalesOf('dateformat', locales, arguments[1]); 397 return supportedLocalesOf('dateformat', locales, arguments[1]);
395 }, 398 },
396 ATTRIBUTES.DONT_ENUM 399 ATTRIBUTES.DONT_ENUM
397 ); 400 );
401 %FunctionSetName(Intl.DateTimeFormat.supportedLocalesOf, 'supportedLocalesOf');
398 %FunctionRemovePrototype(Intl.DateTimeFormat.supportedLocalesOf); 402 %FunctionRemovePrototype(Intl.DateTimeFormat.supportedLocalesOf);
403 %SetNativeFlag(Intl.DateTimeFormat.supportedLocalesOf);
399 404
400 405
401 /** 406 /**
402 * Returns a String value representing the result of calling ToNumber(date) 407 * Returns a String value representing the result of calling ToNumber(date)
403 * according to the effective locale and the formatting options of this 408 * according to the effective locale and the formatting options of this
404 * DateTimeFormat. 409 * DateTimeFormat.
405 */ 410 */
406 function formatDate(formatter, dateValue) { 411 function formatDate(formatter, dateValue) {
407 native function NativeJSInternalDateFormat(); 412 native function NativeJSInternalDateFormat();
408 413
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 469
465 var result = toTitleCaseWord(match[1]) + '/' + toTitleCaseWord(match[2]); 470 var result = toTitleCaseWord(match[1]) + '/' + toTitleCaseWord(match[2]);
466 var i = 3; 471 var i = 3;
467 while (match[i] !== undefined && i < match.length) { 472 while (match[i] !== undefined && i < match.length) {
468 result = result + '_' + toTitleCaseWord(match[i]); 473 result = result + '_' + toTitleCaseWord(match[i]);
469 i++; 474 i++;
470 } 475 }
471 476
472 return result; 477 return result;
473 } 478 }
OLDNEW
« no previous file with comments | « src/extensions/i18n/collator.js ('k') | src/extensions/i18n/footer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698